Learn R Programming

RMAWGEN (version 1.3.7)

getMonthlyMean: Calculates the monthly means of a data frame corresponding to a period between year_min and year_max for stations listed in station

Description

@author Emanuele Cordano, Emanuele Eccel

Usage

getMonthlyMean(data, year_min = 1961, year_max = 1990,
  station = names(data), no_date = FALSE, origin = "1961-1-1",
  yearly = FALSE)

Arguments

data

a dataframe containing daily data.

year_min

start year

year_max

end year

station

character vector of the IDs of the station where the data are requested

no_date

logical value if TRUE the function extractmonths is used. Default is FALSE. It is recommended if data does not contain columns for the dates.

origin

date corresponding to the first row

yearly

logical value. If TRUE the monthly mean values are calculated for each year from year_min to year_max separately. Default is FALSE.

Value

a matrix containing the requested monthly means where each month corresponds to a row and each station corresponds to a column or a list of such matrices in case the monthly mean values are calculated separately for each year (if yearly is TRUE)

See Also

extractyears