[R] Truncating (rounding down) to nearest half hour.

2012-07-19 Thread APOCooter
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,

[R] Script help: Determining Time Difference between two data points.

2012-07-17 Thread APOCooter
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,

Re: [R] Script help: Determining Time Difference between two data points.

2012-07-17 Thread APOCooter
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 -

Re: [R] Questions about doing analysis based on time

2012-07-12 Thread APOCooter
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):

Re: [R] Questions about doing analysis based on time

2012-07-11 Thread APOCooter
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 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

Re: [R] Questions about doing analysis based on time

2012-07-10 Thread APOCooter
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

Re: [R] Questions about doing analysis based on time

2012-06-28 Thread APOCooter
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

Re: [R] Questions about doing analysis based on time

2012-06-25 Thread APOCooter
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

[R] Questions about doing analysis based on time

2012-06-22 Thread APOCooter
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

Re: [R] Questions about doing analysis based on time

2012-06-22 Thread APOCooter
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