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-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 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 ---------------------- ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.