Gavin Simpson wrote: > > > It says that the two arguments have different numbers of observations. > The reason for which should now be pretty obvious as you provided a > single Date whereas airquality has 153 observations. >
Thanks. I did look at ?transform but I was a bit confused because this worked data1 <- transform(airquality,LTMDA=T) whereas this did not data1 <- transform(airquality,Date=as.Date("1950-01-01")) Why does the first one work with one argument but the second one does not? -- View this message in context: http://www.nabble.com/Using-transform-to-add-a-date-column-to-a-dataframe-tp21144414p21146167.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.