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
One question I would have about your commands is that I would have thought
that the second line of output ([2].) would have started with at least
[4] if you were reading multiple lines. This example seems to work fine:
(now that I looked at your code you had $d instead of %d)
x -
On Fri, 2007-02-16 at 14:32 +, Sérgio Nunes wrote:
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 -
Just for the record, here are my steps for producing a date based histogram.
Data is stored in a file where each line only has a date - 2007/02/16
d-readLines(filename.dat)
d-as.Date(d, format=%Y/%m/%d)
pdf(yearly.pdf)
hist(d, years)
dev.off()
Instead of years you can also use days, weeks,
On Fri, 2007-02-16 at 15:39 +, Sérgio Nunes wrote:
Just for the record, here are my steps for producing a date based histogram.
Data is stored in a file where each line only has a date - 2007/02/16
d-readLines(filename.dat)
d-as.Date(d, format=%Y/%m/%d)
pdf(yearly.pdf)
hist(d, years)
On Fri, 16 Feb 2007, Marc Schwartz wrote:
On Fri, 2007-02-16 at 15:39 +, Sérgio Nunes wrote:
Just for the record, here are my steps for producing a date based histogram.
Data is stored in a file where each line only has a date - 2007/02/16
d-readLines(filename.dat)
d-as.Date(d,
On Fri, 2007-02-16 at 16:47 +, Prof Brian Ripley wrote:
On Fri, 16 Feb 2007, Marc Schwartz wrote:
On Fri, 2007-02-16 at 15:39 +, Sérgio Nunes wrote:
Just for the record, here are my steps for producing a date based
histogram.
Data is stored in a file where each line only has a
Hi,
I have several files with data in this format:
20070102
20070102
20070106
20070201
...
The data is sorted and each line represents a date (MMDD). 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
Sérgio Nunes napsal(a):
Hi,
I have several files with data in this format:
20070102
20070102
20070106
20070201
...
The data is sorted and each line represents a date (MMDD). I would
like to analyze this data using R. For instance, I would like to have
a histogram by year, month
Here is a start on what you want to do. This generates some test data and
then does a couple of summaries:
# generate some data
N - 1000
x - data.frame(date=as.character(2007 + sample(1:4, N, TRUE) * 100 +
sample(1:31, N, TRUE)),
+ value=runif(N))
head(x) # display the data
Please note that I do not have values, only dates that represent
occurrences (one link, one date, one occurrence). This means that the
same date might appear several times in different rows. Nevertheless,
I think I can manage this based on your samples.
Thanks,
Sérgio Nunes
On 2/15/07, jim
11 matches
Mail list logo