Re: [R] Time plots

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Mon, 17 Nov 2008 11:16:59 -0500

Also if this is a time series you may wish to represent it as such to facilitate other computations as well. This assumes that the DATE column is first and the remaining columns are numeric:

library(zoo)
mypath <- "/whatever/myfile.csv"
z <- read.zoo(mypath, sep = ",", header = TRUE, format = "%d/%m/%Y") plot(z)

See the three zoo vignettes for more info.

On Mon, Nov 17, 2008 at 11:00 AM, jim holtman <jholtman_at_gmail.com> wrote:
> try
>
> plot(DATE, pH, type='l')
>
> On Mon, Nov 17, 2008 at 10:30 AM, Lathouri, Maria
> <m.lathouri06_at_imperial.ac.uk> wrote:
>> Dear all,
>> I want to do some time plots and actually the dates are in the format of dd/mm/yyyy. So first I input my dataframe in R in a csv form. What I do is
>>
>> DF<-read.csv("C:/Documents and Settings/DF.csv")
>> DATE<-as.Date(DATE, "%d/%m/%Y") # to tell R that DATE column is indeed dates
>> with(DF, plot(DATE,pH))
>>
>> Until here it works fine, but I have the graph plotting only the points. What I want is to have a line (join these points) so to have a time plot. I have tried different commands such as lines(DATE,pH) or with(DF, lines(DATE,pH) but nothing works.
>>
>> What can I do?

>>
>> Yours
>> Lathouri Maria
>>
>> [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help_at_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.
>>
>
>
>
> --
> Jim Holtman
> Cincinnati, OH
> +1 513 646 9390
>
> What is the problem that you are trying to solve?
>
> ______________________________________________
> R-help_at_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.
>



R-help_at_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. Received on Mon 17 Nov 2008 - 16:26:43 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 17 Nov 2008 - 16:30:27 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.

list of date sections of archive