[R] Replace / with - in date

prem_R mtechprem at gmail.com
Thu Apr 15 19:51:20 CEST 2010


Hi,every one .I have searched the solutions in the forum  for replacing my
date value which is in a data frame  ,01/01/2000 to 01-01-2000 using replace
function but got the following warning message
x<-"2000/01/01"
 xd<-as.data.frame(x)
xd$x<-replace(xd$x,xd$x=="/","-")


Warning message:
In `[<-.factor`(`*tmp*`, list, value = "-") :
  invalid factor level, NAs generated

Is there any other method of doing it? or am i missing something?. please
let me know if you need any more information.

Thanks.

Prem
-- 
View this message in context: http://n4.nabble.com/Replace-with-in-date-tp1911391p1911391.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list