I have a list called dataList and would like the name of the lines to be the same as a variable called CNPJ that is within that list. For this, I first applied:
dadosLista<-lapply(dadosLista, "rownames<-", dadosLista$CNPJ)
However, dataList $ CNPJ is considered an empty variable. So I created the CNPJ list:
CNPJ<-lapply(dadosLista, '[', 3)
And then:
dadosLista<-lapply(dadosLista, "rownames<-", CNPJ)
The error appeared:
Error in 'row.names<-.data.frame'('*tmp*', value = value) :
'row.names' com comprimento inválido
It should be some problem I'm having with the understanding of lapply.