[R] Working with temporal data
Sérgio Nunes
snunes at gmail.com
Fri Feb 16 15:32:04 CET 2007
Hi again,
I'm still trying to read my data but I'm having some difficulties
converting it to dates.
My data file has lines and in each line a single date exists in the
format >2007/02/16< (without the >,<). I've tried the following:
> d <- readLines("file.dat")
> d
[1] "2006/08/09" "2004/02/11" "2004/06/09" ...
[2] ...
> d2 <- as.Date(d, format="%Y/%m/$d")
> d2
[1] NA NA NA ...
...
I'm surely doing something wrong.
Any advice would be welcomed.
Thanks!
Sérgio Nunes
On 2/15/07, Sérgio Nunes <snunes at gmail.com> wrote:
> Hi,
>
> I have several files with data in this format:
>
> 20070102
> 20070102
> 20070106
> 20070201
> ...
>
> The data is sorted and each line represents a date (YYYYMMDD). I would
> like to analyze this data using R. For instance, I would like to have
> a histogram by year, month or day.
>
> I've already made a simple Perl script that aggregates this data but I
> believe that R can be much more powerful and easy on this kind of
> work.
>
> Any suggestions on where to start?
>
> Thanks in advance,
> Sérgio Nunes
>
More information about the R-help
mailing list