Re: [R] Extracting data from a file containing data

2015-07-02 Thread Peter Tuju
2, 2015 3:49 AM Subject: Re: [R] Extracting data from a file containing data Here is a way to do case I.  It uses the 'tidyr' package and produces results like: > case1[[1]]     YR JF-R_NINO1.2 MAM-R_NINO1.2 JJA-R_NINO1.2 OND-R_NINO1.21   > 1982           ML            ML  

Re: [R] Extracting data from a file containing data

2015-07-01 Thread jim holtman
Here is a way to do case I. It uses the 'tidyr' package and produces results like: > case1[[1]] YR JF-R_NINO1.2 MAM-R_NINO1.2 JJA-R_NINO1.2 OND-R_NINO1.2 1 1982 MLMLMESE 2 1983 SESESEME 3 1984

Re: [R] Extracting data from a file containing data

2015-06-26 Thread Peter Tuju
| | | | | | | 2.To use the Yearly anomalies for each column in nino regions toclassify the events as;(i). IfANOM Mean>1, then I assign itto “SE” (Being as Strong El-nino)(ii). If0 To: Peter Tuju Cc: "r-help@r-project.org" Sent: Thursday, June 25

Re: [R] Extracting data from a file containing data

2015-06-25 Thread jim holtman
try this: > input <- read.table("C:\\Users\\jh52822\\Downloads\\Nino_indices.txt" + , header = TRUE + , as.is = TRUE + ) > # create factors > input$season <- factor(c(rep("JF", 2), rep("MAM", 3), rep("JJA", 3) + , NA, rep("OND", 3

Re: [R] Extracting data from a file containing data

2015-06-25 Thread jim holtman
What happened to September? Just disregard? Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Thu, Jun 25, 2015 at 11:40 AM, Peter Tuju wrote: > I have the data as attached. For each nino region, I want t

Re: [R] Extracting data from a file containing data

2015-06-25 Thread David L Carlson
4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Peter Tuju Sent: Thursday, June 25, 2015 10:40 AM To: r-help@r-project.org Subject: Re: [R] Extracting data from a file containing data I have the data as attached. For each nino region, I want to get the mea

Re: [R] Extracting data from a file containing data

2015-06-25 Thread Peter Tuju
I have the data as attached. For each nino region, I want to get the mean of the seasons January and February (JF), March, April and may (MAM), June, July and August (JJA), and October, November and December (OND) as columns of each nino regions. and have my result as;For example; For NINO1.2Yea