On Fri, 23 Mar 2007, jim holtman wrote:
> Here is how you can convert them to a Date object:
>
>> x <- c('01.03.2007','02.03.2007','03.03.2007')
>> y <- as.Date(x, format="%d.%m.%Y")
>> y
Well, this is what I tried when reading the docs, but
> mydata <- read.csv(file='mydata.dat', sep = '\t', quote='',
> fill=TRUE,header=TRUE )
> datum <- as.Date(mydata["date"], "%d.%m,%y")
Error in as.Date.default(mydata["date"], "%d.%m,%y") :
do not know how to convert 'mydata["date"]' to class "Date"
I also tried:
> datum <- strptime(imydata["date"], "%d.%m,%y")
> datum
[1] NA
I guess it is a very simple thing I'm doing wrong and missinterpret
the docs.
Thanks for the quick response
Andreas.
--
http://fam-tille.de
______________________________________________
[email protected] 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.