Re: [R] Hourly data with zoo

2011-09-12 Thread steven mosher
worked beautifully. Thanks. On Mon, Sep 12, 2011 at 9:45 AM, Gabor Grothendieck wrote: > On Mon, Sep 12, 2011 at 11:57 AM, steven mosher > wrote: >> Gabor.. thanks. >> >> zr <- zooreg(rnorm(24), as.chron("2011-01-01"), frequency = 24) >> >> a couple issues:  my date data  has missing days and

Re: [R] Hourly data with zoo

2011-09-12 Thread Gabor Grothendieck
On Mon, Sep 12, 2011 at 11:57 AM, steven mosher wrote: > Gabor.. thanks. > > zr <- zooreg(rnorm(24), as.chron("2011-01-01"), frequency = 24) > > a couple issues:  my date data  has missing days and missing hours.. > Sorry if I was not clear on > that.. I input it to a data frame and dates are of t

Re: [R] Hourly data with zoo

2011-09-12 Thread steven mosher
Gabor.. thanks. zr <- zooreg(rnorm(24), as.chron("2011-01-01"), frequency = 24) a couple issues: my date data has missing days and missing hours.. Sorry if I was not clear on that.. I input it to a data frame and dates are of the form 20110101 and hours are in the format 0,100,200 The end goa

Re: [R] Hourly data with zoo

2011-09-12 Thread Gabor Grothendieck
On Mon, Sep 12, 2011 at 1:58 AM, steven mosher wrote: > I have date data as a numeric and hourly data in 0 to 2300 hours in a > dataframe. > > d  <-  rep(20110101,24) > h  <-  seq(from =  0, to  =  2300, by  = 100) > > df  <-  data.frame(LST_DATE  =  d,  LST_TIME  =  h,  data  =  rnorm(24, 0, 1))

Re: [R] Hourly data with zoo

2011-09-12 Thread Dennis Murphy
Hi Steven: How about this? d <- rep(20110101,24) h <- sprintf('%04d', seq(0, 2300, by = 100)) df <- data.frame(LST_DATE = d, LST_TIME = h, data = rnorm(24, 0, 1)) df <- transform(df, datetime = as.POSIXct(paste(LST_DATE, LST_TIME), format = '%Y%m%d %H%M')) library(zoo

[R] Hourly data with zoo

2011-09-11 Thread steven mosher
I have date data as a numeric and hourly data in 0 to 2300 hours in a dataframe. d <- rep(20110101,24) h <- seq(from = 0, to = 2300, by = 100) df <- data.frame(LST_DATE = d, LST_TIME = h, data = rnorm(24, 0, 1)) S <- chron(dates. = as.character(df$LST_DATE), times. = paste(as