[R] how to create analog stripchart plots of x vs t (t=mm/dd/yyyy hh:mm:ss)
Richard Evans
revans at jlab.org
Sat Mar 11 22:00:05 CET 2006
Hello r-experts,
I sure could us a little help.
I have an ever updating text file with timestamped data in it. I can
reformat in anyway I want if need be but currently I have chosen to make
columns of date, time and measuresed value (comma delimeted and with the
dates and times in quotes to interpret them as strings).
Here is a small section of my text data file:
"3/11/2006","15:09",0.014652
"3/11/2006","15:08",0.014652
"3/11/2006","15:06",0.000000
...etc...
I am trying to make a plot of 'X' vs. 't'
where 'x' is a simple numerical vector of N elemets
and 't' is a timestamp like "mm/dd/yyyy hh:mm:ss"
(also of N elements)
here is how i am getting the data:
>
>TheData <- scan("MyDataFile.txt",sep=",",list("","",0))
>TheDates <- TheData[[1]]
>TheTimes <- TheData[[2]]
>TheValue <- TheData[[3]]
>
and here is how i am making the datetime objects:
>
>TimeStampStr <- paste(TheDates,TheTimes)
>TimeStampObj <- strptime(xStamp,"%m/%d/%y %H:%M:%S")
>
and then i try to plot it with:
>
>plot(TimeStampObj,TheValues)
>
but this is where i get an error like this:
>
Read 54 records
Error in plot.window(xlim, ylim, log, asp, ...) :
need finite 'ylim' values
In addition: Warning messages:
1: no finite arguments to min; returning Inf
2: no finite arguments to max; returning -Inf
Can someone help me understand what i need to do?
Am I going about this the wrong way?
Is there a smarter/more elegant way to do this?
And advice is greatly apreciated.
Sincerest thanks (in advance),
- revansx
P.S.
here is an small section of my input file:
More information about the R-help
mailing list