Hi, I am using read.table to get this data that has a timestamp. The data is for many days, but I only want to run the code I wrote only for specific day/days/times. I canĀ“t figure out how to select a timeframe from the list. I have tried using subset() and didn't work
I then used: * timestamp[for(timestamp==as.character("2011-03-15 00:00:00" ) | timestamp==as.character("2011-03-15 00:01:30"))]* but it gives me the list of the timestamp for that interval, but I want the complete data.table for that interval, not just the values of the TIMESTAMP column. Here is the script I use to read the table and select the timestamp interval: *full <- read.table("March_15.dat", sep=",",row.names=NULL, as.is=TRUE,skip=1, header=TRUE) minusrows <- full[-1:-2,] names(minusrows) timestamp <- minusrows[,1] timestamp3 <- timestamp[for(timestamp==as.character("2011-03-15 00:00:00" ) | timestamp==as.character("2011-03-15 00:01:30"))] timestamp3* An example of what minusrows look like: * > minusrows[1:5,1:4] TIMESTAMP RECORD Batt_Volt_Avg attic.air_temp_cool_north 3 2011-03-15 00:00:00 0 13.35 17.99 4 2011-03-15 00:00:30 1 13.35 18.00 5 2011-03-15 00:01:00 2 13.35 17.98 6 2011-03-15 00:01:30 3 13.35 17.99 7 2011-03-15 00:02:00 4 13.35 17.97* Thank You so much for your help and time, -- *Pablo J. Rosado*, *Ph.D. Student* *Graduate Student Researcher Assistant* *University of California - Berkeley* [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.