Hello, Andreas
I'm glad the previous replies helped you solve your problem.
I think your original problem, though,
was caused by a typo. Note
the comma between the month and the year in your script and
the
period between the month and the year in Jim Holtman's
script.
From Jim Holtman:
Hi,
I'm on my very first steps to R and so I hope that I do
not ask a really stupid questions but I did not found it
via R-Search, in the FAQ or Google (BTW, the name R is
not a really good seekiong criterion ;-) ).
I have a data file containing a table that containes
dates and values like
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
[1] 2007-03-01 2007-03-02 2007-03-03
str(y)
Class 'Date' num [1:3] 13573 13574 13575
On 3/23/07, Andreas Tille [EMAIL PROTECTED] wrote:
Hi,
I'm on my
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='',
Read the help desk article in R-News 4/1 and see
?as.Date
?strptime (for setting the as.Date format= argument)
Also, you might be interested in the zoo package
library(zoo)
?read.zoo
vignette(zoo)
vignette(zoo-quickref)
On 3/23/07, Andreas Tille [EMAIL PROTECTED] wrote:
Hi,
I'm on my very
Hi Andreas,
Welcome to r-help :)
On 23 March 2007 at 22:21, Andreas Tille wrote:
| I'm on my very first steps to R and so I hope that I do
| not ask a really stupid questions but I did not found it
| via R-Search, in the FAQ or Google (BTW, the name R is
| not a really good seekiong criterion
On Fri, 23 Mar 2007, Dirk Eddelbuettel wrote:
Nit 1: read.csv() is for csv files which tend to have , as a separator;
read.table() is more useful here.
Well, that's correct. read.csv was just a leftover from former
tests and finally it worked also this way - but thanks for the
hint anyway.