-roger
Jo�o Mendes Moreira wrote:
Hello,
I have the following problem: test is a data frame with 9 fields. The field test$Date is factorized with dates. The format is dd-mm-yyyy (using Oracle notation). I want to convert this to Date in '%Y-%m-%d format. What I am doing is: for (i in 1:nrow(test)) { test[i,]$Data<-strptime(substring(test[i,]$Data,1,10),"%d-%m-%Y") }
test is a data frame.
The error is:
Error in "$<-.data.frame"(`*tmp*`, "Data", value = list(sec = 0, min = 0, : replacement has 9 rows, data has 1
But if I do: strptime(substring(test[1:nrow(teste),]$Data,1,10),"%d-%m-%Y") it works! Why the assignement does not work?
Thanks
Joao Moreira [[alternative HTML version deleted]]
______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
-- Roger D. Peng http://www.biostat.jhsph.edu/~rpeng/
______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
