I have a date.frame, I changed the data class of the date column, and then I separated the other three column through the Separate command whose names were% Y,% me% d, I would like to change these names to year, month it is day. However, when trying to rename the columns, using the Rename command gives an error.
> as.data <- as.Date(dados$data)
> meus.dados <- separate(data = dados, col = data, into = c("%Y", "%m","%d"), sep = "-")
> meus.dados[1:5, 1:9]
Source: local data frame [5 x 9]
posicao %Y %m %d especie BF CA2 CB CP
(chr) (chr) (chr) (chr) (chr) (dbl) (dbl) (dbl) (dbl)
1 direita 2012 05 22 Canis familiaris 0 0 0 0
2 direita 2012 05 22 Canis familiaris 0 0 0 0
3 esquerda 2012 05 24 Dasypus novemcinctus 0 0 0 1
4 esquerda 2012 05 25 Canis familiaris 1 0 0 0
5 esquerda 2012 05 26 Dasypus novemcinctus 0 0 0 1
> rename(meus.dados, ano=" %Y", mes="%m", dia="%d")
Error: Arguments to rename must be unquoted variable names. Arguments ano, mes, dia are not.
I do not know what to do !!