Skip to content
Prev 165402 / 398513 Next

Using transform to add a date column to a dataframe

Gavin Simpson wrote:
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?