Re: [R] working with strptime data

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Fri 15 Sep 2006 - 00:15:42 GMT

Read the help desk article in R News 4/1.

On 9/14/06, Richard Evans <revans@jlab.org> wrote:
> Dear R-forum,
>
> I am looking for a good resource/help on working with POSIXct values and
> controlling the pretty x-axis labels and tick marks for a data VS time
> plots. Specifically, I wish to do programming logic which creates
> different vertical ablines calculations based on the range of times
> which i am working on. The default plot results are adequate, but I
> would love to make explicit calls on how the x-axis annotates the
> timestamps.
>
> Does anyone have example code or know of a good reference for these
> kinds of R-programming tasks?
>
>
> Here's a simplified example:
> ----------------------------------------------------------
> I have a large data set that consists of N pairs of values and
> timestamps strings.
> Like this:
>
> TheData <- c(1.2, 0.9, etc...[to the Nth
> datapoint])
> TheTime <- c("9/1/2006 8:00", "9/1/2006 8:13", etc...[to the Nth
> timestamp])
>
> I convert the timestamp strings into POSIXct types as:
>
> TheTime <- as.POSIXct(strptime(TheTime, format="%m/%d/%Y %H:%M"))
>
> And create a plot as such:
>
> plot(MyTime,MyData)
>
> ----------------------------------------------------------
>
> And here is a specific question:
>
> How do I calculate the number of months than are spanned between two
> POSIXct values?
> (i.e. NumOfMonths <- MonthFunction(range(MyTimeStampData))
>
> Thanks-in-advance,
> - rich
>
> ______________________________________________
> R-help@stat.math.ethz.ch 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.
>



R-help@stat.math.ethz.ch 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. Received on Fri Sep 15 10:20:51 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 15 Sep 2006 - 01:30:05 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.