Re: [R] Changing Date Variables as Continuous Variables

2012-11-03 Thread Rolf Turner
There is a phenomenon that occurs here which, it seems to me, merits some emphasis. The glm() function appears to be perfectly willing to take a variable of class "Date" and treat it as a continuous variable. Apparently what it does (on the basis of one little experiment that I did) is convert

Re: [R] Changing Date Variables as Continuous Variables

2012-11-03 Thread jim holtman
Here is how to convert your column of factors into Dates: > x <- read.table(text = '2/10/2011 + 2/20/2011 + 3/4/2011') > # read in as factors > str(x) 'data.frame': 3 obs. of 1 variable: $ V1: Factor w/ 3 levels "2/10/2011","2/20/2011",..: 1 2 3 > # convert to Date > x$date <- as.Date(as.chara