I have 50 variables named Date1 - Date50
stored in data1
(among other variables).
The initial format of Date1 - Date50
is "factor
".
The values are like "24.01.2014
".
How can I format all 50 variables as a Date at once?
For a single variable the following command works fine:
data1$Date1<-as.Date("data1$Date1", format="%d.%m.%Y")
I tried several ways with "lapply" but without success.
Thanks!