Dear Jim Holtman, Thank you very much for your help. Theproblem I'm trying to solve is ?To determine weather the evolutionof ENSO can influence rainfall over Tanzania?. In this study I havetwo types of data, ie Rainfall data (for 23 stations) and Ninoindices data, both spanning a period of 31 years (1982-2012). CASEI:1.In ?Nino.indices.txt? data for all columns of the ninoregions (both for anomalies and SST), to calculate the Season means"January & February (JF)", ?March, April and may(MAM)", "June, July & August (JJA)" and "October,November and December (OND" for each year. and have the outputin table form as; Ninoindices Mean | Years | JF SST Mean NINO1+2 | JF ANOM Mean NINO1+2 | MAM SST Mean NINO3 | MAM ANOM Mean NINO3 | JJA SST Mean NINO4 | JJA ANOM Mean NINO4 | OND SST Mean NINO3.4 | OND SST Mean NINO3.4 | | 1982 | | | | | | | | | | 1983 | | | | | | | | | | - - - - | | | | | | | | | | - - - - | | | | | | | | | | 2012 | | | | | | | | | 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<ANOMMean<=1 , then Iassign it to ?ME? (Being as Moderate El-nino)(iii). IfANOM==0,then I assign it to ?NT? (Being as NeutralCondition)(iv). If ANOMMean< (-1),then I assign it to ?SL? (Being as Strong La-nina)(v). If-1<=ANOMMean< 0, then I assign it to ?ML? (Being as Moderate La-nina)Theoutput have to be in table form as; FORNINO1+2 | Years | JF ANOM Mean NINO1+2 | MAM ANOM Mean NINO1+2 | JJA ANOM Mean NINO1+2 | OND SST Mean NINO1+2 | | 1982 | SE | | | | | 1983 | | | SL | | | - - - - | | | | ML | | - - - - | | ME | | | | 2012 | | | | SL | FORNINO3 | Years | JF ANOM Mean NINO3 | MAM ANOM Mean NINO3 | JJA ANOM Mean NINO3 | OND SST Mean NINO3 | | 1982 | SE | | | | | 1983 | | | | | | - - - - | | | | | | - - - - | | ME | | | | 2012 | | | | SL | FORNINO4 | Years | JF ANOM Mean NINO4 | MAM ANOM Mean NINO4 | JJA ANOM Mean NINO4 | OND SST Mean NINO4 | | 1982 | SE | | | | | 1983 | | | | | | - - - - | ML | | | SL | | - - - - | | ME | | | | 2012 | | | | SL | FORNINO3.4 | Years | JF ANOM Mean NINO3.4 | MAM ANOM Mean NINO3.4 | JJA ANOM Mean NINO3.4 | OND SST Mean NINO3.4 | | 1982 | SE | SL | | | | 1983 | | | | | | - - - - | | | ML | | | - - - - | | ME | | | | 2012 | | | | SL | 3.To plot the time series graph for each nino regions using the YearlyAnomalies. CASEII:Consider the Rainfall station data;1. In some files containing the data there are missing data labeledby variable ?m?. I want to substitute these missing data withlong term mean.2. Find the rowSum and anomalies of each file containing the data.3. To find the cumsum of the rowSum of each file containing the data.4. Plot the single mass curves ie. Plot(Year, cumsum) for each fileand name its title as the name of the corresponding file name.5. Plot the time series graphs for seasons JF, MAM, JJA and OND foreach file and name give its name as ?Time series graph for ?nameof the file??6. To find the seasonal correlations for JF, MAM, JJA and OND usingthe anomalies of the rainfall station data and that of each ninoregion indices, and have the results in table form as; CORRELATIONSOF RAINFALL AND NINO1+2 ANOMALIES | Years | JF | MAM | JJA | OND | | 1982 | | | | | | 1983 | | | | | | - - - - | | | | | | - - - - | | | | | | 2012 | | | | | CORRELATIONSOF RAINFALL AND NINO3ANOMALIES | Years | JF | MAM | JJA | OND | | 1982 | | | | | | 1983 | | | | | | - - - - | | | | | | - - - - | | | | | | 2012 | | | | | CORRELATIONSOF RAINFALL AND NINO4ANOMALIES | Years | JF | MAM | JJA | OND | | 1982 | | | | | | 1983 | | | | | | - - - - | | | | | | - - - - | | | | | | 2012 | | | | | CORRELATIONSOF RAINFALL AND NINO3.4ANOMALIES | Years | JF | MAM | JJA | OND | | 1982 | | | | | | 1983 | | | | | | - - - - | | | | | | - - - - | | | | | | 2012 | | | | | ?Please find attached the data to be used in this analysis. Hopefully you will help. _____________ Peter? E. Tuju Dar es Salaam T A N Z A N I A ---------------------- From: jim holtman <jholtman at gmail.com> To: Peter Tuju <peterenos at ymail.com> Cc: "r-help at r-project.org" <r-help at r-project.org> Sent: Thursday, June 25, 2015 10:12 PM Subject: Re: [R] Extracting data from a file containing data 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)+ ? ? ? ? )[input$MON], levels = c("JF", "MAM", "JJA", "OND"))> ? ? ? ??> # leave off the MON (-2) column from the data ? ? ? ? ? ?> res <- aggregate(. ~ season + YR, data = input[, -2], FUN = 'mean')> head(res,10)? ?season ? YR ?NINO1.2 ? ? ? ANOM ? ?NINO3 ? ? ANOM.1 ? ?NINO4 ? ? ANOM.2 ?NINO3.4 ? ? ANOM.31 ? ? ?JF 1982 24.89000 -0.3750000 26.12500 ?0.1250000 28.25500 ?0.0550000 26.71000 ?0.06500002 ? ? MAM 1982 24.56000 -0.8366667 27.48333 ?0.2433333 28.94000 ?0.4466667 27.92000 ?0.30333333 ? ? JJA 1982 22.37000 ?0.6800000 26.68333 ?1.0033333 29.39333 ?0.6200000 28.26000 ?1.03000004 ? ? OND 1982 24.55333 ?2.8200000 27.70667 ?2.6933333 29.25333 ?0.6600000 28.88667 ?2.25000005 ? ? ?JF 1983 27.75500 ?2.4900000 28.92000 ?2.9200000 28.89500 ?0.6950000 29.24500 ?2.60000006 ? ? MAM 1983 28.47667 ?3.0800000 29.06333 ?1.8233333 28.89667 ?0.4033333 28.94333 ?1.32666677 ? ? JJA 1983 25.72333 ?4.0333333 26.88000 ?1.2000000 28.63667 -0.1366667 27.28000 ?0.05000008 ? ? OND 1983 22.25667 ?0.5233333 24.40667 -0.6066667 27.77667 -0.8166667 25.68000 -0.95666679 ? ? ?JF 1984 24.68000 -0.5850000 25.52000 -0.4800000 27.44500 -0.7550000 26.01500 -0.630000010 ? ?MAM 1984 24.79667 -0.6000000 26.97333 -0.2666667 27.62000 -0.8733333 27.21333 -0.4033333>?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 <peterenos at ymail.com> wrote: 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 at 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. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: Nino_indices.txt URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20150626/975d53c4/attachment.txt>
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 ML ML ME SE 2 1983 SE SE SE ME 3 1984 ML ML ML ML 4 1985 SL SL SL ML 5 1986 ME ML ML ME 6 1987 ME SE SE SE 7 1988 ML ML SL SL 8 1989 ML ML ML ML 9 1990 ML ML ML ML 10 1991 ML ML ME ME 11 1992 ME SE ME ML 12 1993 ME ME ME ME 13 1994 ML SL ML ME 14 1995 ME ML ML ML 15 1996 ML SL SL SL 16 1997 ML SE SE SE 17 1998 SE SE SE ML 18 1999 ML ML SL ML 19 2000 ML ML ML ML 20 2001 ML ME ML SL 21 2002 ML ME ML ME 22 2003 ML SL ML ME 23 2004 ML ML SL ME 24 2005 ML ML ML ML 25 2006 ME ML ME SE 26 2007 ME SL SL SL 27 2008 ML ME ME ML 28 2009 ML ME ME ME 29 2010 ME ME SL SL 30 2011 ML ME ME ML 31 2012 ML ME ME ML 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 Fri, Jun 26, 2015 at 5:27 AM, Peter Tuju <peterenos at ymail.com> wrote:> Dear Jim Holtman, > > Thank you very much for your help. > > The problem I'm trying to solve is ?To determine weather the evolution of > ENSO can influence rainfall over Tanzania?. In this study I have two types > of data, ie Rainfall data (for 23 stations) and Nino indices data, both > spanning a period of 31 years (1982-2012). > > *CASE I:* > 1. In ?*Nino.indices.txt*? data for all columns of the nino regions (both > for anomalies and SST), to calculate the Season means "January & February > (JF)", ?March, April and may (MAM)", "June, July & August (JJA)" and > "October, November and December (OND" for each year. and have the output in > table form as; > > *Nino indices Mean* > Years > JF > SST Mean > NINO1+2 > JF > ANOM Mean > NINO1+2 > MAM > SST Mean > NINO3 > MAM > ANOM Mean > NINO3 > JJA > SST Mean > NINO4 > JJA > ANOM Mean > NINO4 > OND > SST Mean > NINO3.4 > OND > SST Mean > NINO3.4 > 1982 > > > > > > > > > 1983 > > > > > > > > > - - - - > > > > > > > > > - - - - > > > > > > > > > 2012 > > > > > > > > > > 2. To use the Yearly anomalies for each column in nino regions to > classify the events as; > (i). If ANOM Mean> 1, then I assign it to ?SE? (Being as Strong El-nino) > (ii). If 0<ANOM Mean<=1 , then I assign it to ?ME? (Being as Moderate > El-nino) > (iii). If ANOM== 0, then I assign it to ?NT? (Being as Neutral Condition) > (iv). If ANOM Mean< (-1), then I assign it to ?SL? (Being as Strong > La-nina) > (v). If -1<=ANOM Mean< 0 , then I assign it to ?ML? (Being as Moderate > La-nina) > The output have to be in table form as; > > *FOR NINO1+2* > Years > JF > ANOM Mean > NINO1+2 > MAM > ANOM Mean > NINO1+2 > JJA > ANOM Mean > NINO1+2 > OND > SST Mean > NINO1+2 > 1982 > SE > > > > 1983 > > > SL > > - - - - > > > > ML > - - - - > > ME > > > 2012 > > > > *SL* > > *FOR NINO3* > Years > JF > ANOM Mean > NINO3 > MAM > ANOM Mean > NINO3 > JJA > ANOM Mean > NINO3 > OND > SST Mean > NINO3 > 1982 > *SE * > > > > 1983 > > > > > - - - - > > > > > - - - - > > ME > > > 2012 > > > > *SL* > > *FOR NINO4* > Years > JF > ANOM Mean > NINO4 > MAM > ANOM Mean > NINO4 > JJA > ANOM Mean > NINO4 > OND > SST Mean > NINO4 > 1982 > *SE * > > > > 1983 > > > > > - - - - > ML > > > SL > - - - - > > ME > > > 2012 > > > > *SL* > > > *FOR NINO3.4* > Years > JF > ANOM Mean > NINO3.4 > MAM > ANOM Mean > NINO3.4 > JJA > ANOM Mean > NINO3.4 > OND > SST Mean > NINO3.4 > 1982 > *SE * > SL > > > 1983 > > > > > - - - - > > > ML > > - - - - > > ME > > > 2012 > > > > *SL* > > > 3. To plot the time series graph for each nino regions using the Yearly > Anomalies. > > > *CASE II:* > Consider the Rainfall station data; > 1. In some files containing the data there are missing data labeled by > variable ?m?. I want to substitute these missing data with long term mean. > 2. Find the rowSum and anomalies of each file containing the data. > 3. To find the cumsum of the rowSum of each file containing the data. > 4. Plot the single mass curves ie. Plot(Year, cumsum) for each file and > name its title as the name of the corresponding file name. > 5. Plot the time series graphs for seasons JF, MAM, JJA and OND for each > file and name give its name as ?Time series graph for ?name of the file?? > 6. To find the seasonal correlations for JF, MAM, JJA and OND using the > anomalies of the rainfall station data and that of each nino region > indices, and have the results in table form as; > > *CORRELATIONS OF RAINFALL AND NINO1+2 ANOMALIES* > *Years* > *JF* > *MAM* > *JJA* > *OND* > *1982 * > > > > > *1983* > > > > > *- - - -* > > > > > *- - - -* > > > > > *2012* > > > > > > *CORRELATIONS OF RAINFALL AND NINO3 ANOMALIES* > *Years* > *JF* > *MAM* > *JJA* > *OND* > *1982 * > > > > > *1983* > > > > > *- - - -* > > > > > *- - - -* > > > > > *2012* > > > > > > *CORRELATIONS OF RAINFALL AND NINO4 ANOMALIES* > *Years* > *JF* > *MAM* > *JJA* > *OND* > *1982 * > > ... > > [Message clipped]-------------- next part -------------- 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) )[input$MON], levels = c("JF", "MAM", "JJA", "OND")) # leave off the MON (-2) column from the data res <- aggregate(. ~ season + YR, data = input[, -2], FUN = 'mean') head(res,10) # this function determines the labels to apply f_labels <- function(x) { result <- as.character(cut(x # convert to character since it is a factor , breaks = c(-Inf, -1, 0, 1, Inf) , labels = c("SL", "ML", "ME", "SE") )) # check for zero result[x == 0] <- "NT" result } # get the "ANOM" columns for processing since these are the ones that # we want to test for values. anom <- which(grepl("^ANOM", names(res))) # for each ANOM column iterate and compute the labels based on values for (i in anom){ # use the variable in previous column for the name res[[paste0("R_", names(res[i - 1L]))]] <- f_labels(res[[i]]) } # the tidyr package helps to format the results require(tidyr) # columns to use as summary -- added above sum_cols <- paste0("R_", names(res[anom - 1L])) case1 <- lapply(sum_cols, function(.col){ # need to restrict what data we want x <- spread_(res[, c("YR", "season", .col)], "season", .col) # append the name of the data to the season names(x)[-1] <- paste(names(x[-1]), .col, sep = '-') x # return value })
Dear Jim,Thank you very much indeed. Its a great job you have done and I really appreciate.Thank you so much. ?_____________ Peter? E. Tuju Dar es Salaam T A N Z A N I A ---------------------- From: jim holtman <jholtman at gmail.com> To: Peter Tuju <peterenos at ymail.com> Cc: "r-help at r-project.org" <r-help at r-project.org> Sent: Thursday, July 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 ? ? ? ? ? ?ME ? ? ? ? ? ?SE2 ?1983 ? ? ? ? ? SE ? ? ? ? ? ?SE ? ? ? ? ? ?SE ? ? ? ? ? ?ME3 ?1984 ? ? ? ? ? ML ? ? ? ? ? ?ML ? ? ? ? ? ?ML ? ? ? ? ? ?ML4 ?1985 ? ? ? ? ? SL ? ? ? ? ? ?SL ? ? ? ? ? ?SL ? ? ? ? ? ?ML5 ?1986 ? ? ? ? ? ME ? ? ? ? ? ?ML ? ? ? ? ? ?ML ? ? ? ? ? ?ME6 ?1987 ? ? ? ? ? ME ? ? ? ? ? ?SE ? ? ? ? ? ?SE ? ? ? ? ? ?SE7 ?1988 ? ? ? ? ? ML ? ? ? ? ? ?ML ? ? ? ? ? ?SL ? ? ? ? ? ?SL8 ?1989 ? ? ? ? ? ML ? ? ? ? ? ?ML ? ? ? ? ? ?ML ? ? ? ? ? ?ML9 ?1990 ? ? ? ? ? ML ? ? ? ? ? ?ML ? ? ? ? ? ?ML ? ? ? ? ? ?ML10 1991 ? ? ? ? ? ML ? ? ? ? ? ?ML ? ? ? ? ? ?ME ? ? ? ? ? ?ME11 1992 ? ? ? ? ? ME ? ? ? ? ? ?SE ? ? ? ? ? ?ME ? ? ? ? ? ?ML12 1993 ? ? ? ? ? ME ? ? ? ? ? ?ME ? ? ? ? ? ?ME ? ? ? ? ? ?ME13 1994 ? ? ? ? ? ML ? ? ? ? ? ?SL ? ? ? ? ? ?ML ? ? ? ? ? ?ME14 1995 ? ? ? ? ? ME ? ? ? ? ? ?ML ? ? ? ? ? ?ML ? ? ? ? ? ?ML15 1996 ? ? ? ? ? ML ? ? ? ? ? ?SL ? ? ? ? ? ?SL ? ? ? ? ? ?SL16 1997 ? ? ? ? ? ML ? ? ? ? ? ?SE ? ? ? ? ? ?SE ? ? ? ? ? ?SE17 1998 ? ? ? ? ? SE ? ? ? ? ? ?SE ? ? ? ? ? ?SE ? ? ? ? ? ?ML18 1999 ? ? ? ? ? ML ? ? ? ? ? ?ML ? ? ? ? ? ?SL ? ? ? ? ? ?ML19 2000 ? ? ? ? ? ML ? ? ? ? ? ?ML ? ? ? ? ? ?ML ? ? ? ? ? ?ML20 2001 ? ? ? ? ? ML ? ? ? ? ? ?ME ? ? ? ? ? ?ML ? ? ? ? ? ?SL21 2002 ? ? ? ? ? ML ? ? ? ? ? ?ME ? ? ? ? ? ?ML ? ? ? ? ? ?ME22 2003 ? ? ? ? ? ML ? ? ? ? ? ?SL ? ? ? ? ? ?ML ? ? ? ? ? ?ME23 2004 ? ? ? ? ? ML ? ? ? ? ? ?ML ? ? ? ? ? ?SL ? ? ? ? ? ?ME24 2005 ? ? ? ? ? ML ? ? ? ? ? ?ML ? ? ? ? ? ?ML ? ? ? ? ? ?ML25 2006 ? ? ? ? ? ME ? ? ? ? ? ?ML ? ? ? ? ? ?ME ? ? ? ? ? ?SE26 2007 ? ? ? ? ? ME ? ? ? ? ? ?SL ? ? ? ? ? ?SL ? ? ? ? ? ?SL27 2008 ? ? ? ? ? ML ? ? ? ? ? ?ME ? ? ? ? ? ?ME ? ? ? ? ? ?ML28 2009 ? ? ? ? ? ML ? ? ? ? ? ?ME ? ? ? ? ? ?ME ? ? ? ? ? ?ME29 2010 ? ? ? ? ? ME ? ? ? ? ? ?ME ? ? ? ? ? ?SL ? ? ? ? ? ?SL30 2011 ? ? ? ? ? ML ? ? ? ? ? ?ME ? ? ? ? ? ?ME ? ? ? ? ? ?ML31 2012 ? ? ? ? ? ML ? ? ? ? ? ?ME ? ? ? ? ? ?ME ? ? ? ? ? ?MLJim 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 Fri, Jun 26, 2015 at 5:27 AM, Peter Tuju <peterenos at ymail.com> wrote: Dear Jim Holtman, Thank you very much for your help. Theproblem I'm trying to solve is ?To determine weather the evolutionof ENSO can influence rainfall over Tanzania?. In this study I havetwo types of data, ie Rainfall data (for 23 stations) and Ninoindices data, both spanning a period of 31 years (1982-2012). CASEI:1.In ?Nino.indices.txt? data for all columns of the ninoregions (both for anomalies and SST), to calculate the Season means"January & February (JF)", ?March, April and may(MAM)", "June, July & August (JJA)" and "October,November and December (OND" for each year. and have the outputin table form as; Ninoindices Mean | Years | JF SST Mean NINO1+2 | JF ANOM Mean NINO1+2 | MAM SST Mean NINO3 | MAM ANOM Mean NINO3 | JJA SST Mean NINO4 | JJA ANOM Mean NINO4 | OND SST Mean NINO3.4 | OND SST Mean NINO3.4 | | 1982 | | | | | | | | | | 1983 | | | | | | | | | | - - - - | | | | | | | | | | - - - - | | | | | | | | | | 2012 | | | | | | | | | 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<ANOMMean<=1 , then Iassign it to ?ME? (Being as Moderate El-nino)(iii). IfANOM==0,then I assign it to ?NT? (Being as NeutralCondition)(iv). If ANOMMean< (-1),then I assign it to ?SL? (Being as Strong La-nina)(v). If-1<=ANOMMean< 0, then I assign it to ?ML? (Being as Moderate La-nina)Theoutput have to be in table form as; FORNINO1+2 | Years | JF ANOM Mean NINO1+2 | MAM ANOM Mean NINO1+2 | JJA ANOM Mean NINO1+2 | OND SST Mean NINO1+2 | | 1982 | SE | | | | | 1983 | | | SL | | | - - - - | | | | ML | | - - - - | | ME | | | | 2012 | | | | SL | FORNINO3 | Years | JF ANOM Mean NINO3 | MAM ANOM Mean NINO3 | JJA ANOM Mean NINO3 | OND SST Mean NINO3 | | 1982 | SE | | | | | 1983 | | | | | | - - - - | | | | | | - - - - | | ME | | | | 2012 | | | | SL | FORNINO4 | Years | JF ANOM Mean NINO4 | MAM ANOM Mean NINO4 | JJA ANOM Mean NINO4 | OND SST Mean NINO4 | | 1982 | SE | | | | | 1983 | | | | | | - - - - | ML | | | SL | | - - - - | | ME | | | | 2012 | | | | SL | FORNINO3.4 | Years | JF ANOM Mean NINO3.4 | MAM ANOM Mean NINO3.4 | JJA ANOM Mean NINO3.4 | OND SST Mean NINO3.4 | | 1982 | SE | SL | | | | 1983 | | | | | | - - - - | | | ML | | | - - - - | | ME | | | | 2012 | | | | SL | 3.To plot the time series graph for each nino regions using the YearlyAnomalies. CASEII:Consider the Rainfall station data;1. In some files containing the data there are missing data labeledby variable ?m?. I want to substitute these missing data withlong term mean.2. Find the rowSum and anomalies of each file containing the data.3. To find the cumsum of the rowSum of each file containing the data.4. Plot the single mass curves ie. Plot(Year, cumsum) for each fileand name its title as the name of the corresponding file name.5. Plot the time series graphs for seasons JF, MAM, JJA and OND foreach file and name give its name as ?Time series graph for ?nameof the file??6. To find the seasonal correlations for JF, MAM, JJA and OND usingthe anomalies of the rainfall station data and that of each ninoregion indices, and have the results in table form as; CORRELATIONSOF RAINFALL AND NINO1+2 ANOMALIES | Years | JF | MAM | JJA | OND | | 1982 | | | | | | 1983 | | | | | | - - - - | | | | | | - - - - | | | | | | 2012 | | | | | CORRELATIONSOF RAINFALL AND NINO3ANOMALIES | Years | JF | MAM | JJA | OND | | 1982 | | | | | | 1983 | | | | | | - - - - | | | | | | - - - - | | | | | | 2012 | | | | | CORRELATIONSOF RAINFALL AND NINO4ANOMALIES | Years | JF | MAM | JJA | OND | | 1982 | | | ... [Message clipped]?? [[alternative HTML version deleted]]