2
I have a list called dataList and I would like the name of the lines to be equal to a variable called CNPJ that is within that list. For that, I first applied:
dadosLista<-lapply(dadosLista, "rownames<-", dadosLista$CNPJ)
However, dataLista$CNPJ is considered an empty variable. Thus, I created the CNPJ list:
CNPJ<-lapply(dadosLista, `[`, 3)
And then:
dadosLista<-lapply(dadosLista, "rownames<-", CNPJ)
Error appeared:
Error in `row.names<-.data.frame`(`*tmp*`, value = value) :
'row.names' com comprimento inválido
Must be some problem I’m having with understanding lapply.
A
dput(dadosLista)
could help– Tomás Barcellos