[R] Extracting data from a file containing data

David L Carlson dcarlson at tamu.edu
Thu Jun 25 20:25:52 CEST 2015


First, create a variable (a factor) for your categories (did you really intend to exclude September?).

Then use the aggregate function.

?factor
?aggregate

-------------------------------------
David L Carlson
Department of Anthropology
Texas A&M University
College Station, TX 77840-4352

-----Original Message-----
From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Peter Tuju
Sent: Thursday, June 25, 2015 10:40 AM
To: r-help at 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 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.2Years     JF      MAMA     JJA      OND 1982 1983    .    .     .2012
Any guide please!


_____________
Peter  E. Tuju
Dar es Salaam
T A N Z A N I A
----------------------


More information about the R-help mailing list