26 PM
> To: Williams, Robin
> Cc: R-help@r-project.org
> Subject: Re: [R] Subsetting data by date
>
> Continuing on, to just get points from May to Sep
>
> mo <- as.numeric(format(time(z), "%m"))
> z.summer <- z[mo >= 5 & mo <= 9]
>
> If in your case
?subset is one of several ways. You don't need a loop. Loops are BAD in R :)
--- On Mon, 7/21/08, Williams, Robin <[EMAIL PROTECTED]> wrote:
> From: Williams, Robin <[EMAIL PROTECTED]>
> Subject: Re: [R] Subsetting data by date
> To: "Gabor Grothendieck"
PM
> To: Williams, Robin
> Cc: R-help@r-project.org
> Subject: Re: [R] Subsetting data by date
>
> Continuing on, to just get points from May to Sep
>
> mo <- as.numeric(format(time(z), "%m"))
> z.summer <- z[mo >= 5 & mo <= 9]
>
> If in your case
]
-Original Message-
From: Gabor Grothendieck [mailto:[EMAIL PROTECTED]
Sent: Monday, July 21, 2008 3:26 PM
To: Williams, Robin
Cc: R-help@r-project.org
Subject: Re: [R] Subsetting data by date
Continuing on, to just get points from May to Sep
mo <- as.numeric(format(time(z),
Forecasting
[EMAIL PROTECTED]
-Original Message-
From: Gabor Grothendieck [mailto:[EMAIL PROTECTED]
Sent: Monday, July 21, 2008 3:26 PM
To: Williams, Robin
Cc: R-help@r-project.org
Subject: Re: [R] Subsetting data by date
Continuing on, to just get points from May to Sep
mo <- as.nume
Continuing on, to just get points from May to Sep
mo <- as.numeric(format(time(z), "%m"))
z.summer <- z[mo >= 5 & mo <= 9]
If in your case z is multivariate rather than univariate (as it is in
our example) then it would be:
z.summer <- z[mo >= 5 & mo <= 9, ]
On Mon, Jul 21, 2008 at 9:55 AM, Gabo
Try this:
Lines <- "Date,Temp
1-Apr-1997,50
3-Sept-2001,60"
library(zoo)
# function to reduce 4 char mos to 3 char
convert.date <- function(x, format) as.Date(sub("(-...).-", "\\1-", x), format)
# z <- read.zoo("myfile.csv", header = TRUE, sep = ",", FUN =
convert.date, format = "%d-%b-%Y")
z <
Hi all,
Firstly I appologise if this question has been answered previously,
however searching of the archives and the internet generally has not
yielded any results.
I am looking in to the effects of summer weather conditions
(temperature, humidity etc), on the incidences of a breathing dis
8 matches
Mail list logo