Re: [R] importing and filtering time series data

2011-05-02 Thread Joel Reymont
My current code looks like this. Anything that can be improved? #! /usr/bin/rscript # install.packages(c('zoo','xts')) library(zoo) library(xts) req_stats <- function(data, type = NA) { if (is.na(type)) csv <- data else # subset of data matching our request type csv <- subset(da

Re: [R] importing and filtering time series data

2011-05-01 Thread jim holtman
Here is one approach. It would be good to provide a reasonable sample of data: > x <- unclass(Sys.time()) # today's date > # create some data > # increments by ~ 0.1 seconds > len <- cumsum(runif(100, 0, 0.1)) > dataFile <- data.frame(time = x + len, +flag = sample(c("Y",

[R] importing and filtering time series data

2011-04-29 Thread Joel Reymont
Folks, I'm new to R and would like to use it to analyze web server performance data. I collect the data in this CSV format: 1304083104.41,Y,668.856249809 1304083104.41,Y,348.143193007 First column is a timestamp, rows with N instead of Y need to be skipped and the last column has the same fo