Man, R has a steep learning curve (but I suppose you all know this). I have
very little programming knowledge, so when I search for answers to my
questions, I struggle with making sense of a lot of the pages.
I have a spreadsheet that I've read into R using read.csv. I've also
attached it. It l
Here is a part of the data for the first two questions:
> head(Sunday,100)
SunDate SunTime SunScore
1 5/9/2010 0:000:00 127
26/12/2011 0:000:00 125
36/15/2008 0:040:04 98
4 8/3/2008 0:070:07 118
57/24/2011 0:070:07 122
6
Oh, whoops. When I responded the first time, I had done dput(head(Sunday,
100)) too, but it didn't look useful. It was only just now that I saw that
it basically prints out the vectors. Sorry about that.
Anyways, here's dput(head(Sunday, 100)):
> dput(head(Sunday, 100))
structure(list(SunDate
That is very helpful, and exactly what I was looking for!
However, I seem to have some problems. When I ran the following line:
aggregate(SunScore ~ h, data=dat, mean)
I got the following output:
h SunScore
1 0 136.01389
2 1 135.27632
3 2 127.03704
4 3 127.17105
5 4 129.94545
6
Thanks to everyone for their help so far. It's been greatly appreciated. I
have a new, but similar problem:
I have data that I have broken down by hour (median/mean for each hour). I
would like to break it down further, by each half hour (0:00-0:29,
0:30-0:59, 1:00-1:29, 1:30-1:59, etc). I tho
cut.POSIXt from package base.
>
> cut(dat$SunDate, breaks="30 mins")
>
>
> Hope this helps,
>
> Rui Barradas
>
> Em 10-07-2012 13:43, APOCooter escreveu:
>> Thanks to everyone for their help so far. It's been greatly appreciated.
>> I
&g
Another new question:
I want to be able to subset the data based on whether or not that data point
was recorded on a holiday. The is.holiday() function from the chron package
would be perfect for this. However, when I try it, the following happens
(I'm also using the timeDate package):
> holida
I have the following data (a subset of the real data set):
structure(list(Date = structure(c(1209625080, 1209641460, 1209652500,
1209676800, 1209682860, 1209692100, 1209706980, 1209722580, 1209726300,
1209739620, 1209762780, 1209765720, 1209770520, 1209791040, 1209812580,
1209829920, 1209837180
Yes! That does exactly what I want it to. Thank you so much.
One question, though, is it possible that the time difference be in hours
instead of seconds (other than dividing by 3600)? Looking at the code, I
don't know what I would change.
Does this do what you want?
> firstInRun <- functio
I couldn't find anything in the chron or timeDate packages, and a good search
yielded rounding to the nearest half hour, which I don't want.
The data:
structure(list(Date = structure(c(1209625080, 1209641460, 1209652500,
1209676800, 1209682860, 1209692100, 1209706980, 1209722580, 1209726300,
12
10 matches
Mail list logo