Compute monthly data from daily series
Daily series are aggregated into total, mean, maximum, or minimum monthly values, and saved to files for further processing.
dd2m(varcli, anyi, anyf, anyip=anyi, anyfp=anyf, ndec=1, suf=NA, valm=2, namax=10, na.strings="NA", homog=FALSE, ini=NA)
varcli |
Acronym of the name of the studied climatic variable, as in the data file name. |
anyi |
Initial year of the data present in the file. |
anyf |
Final year of the data present in the file. |
anyip |
First year of the output period. (Defaults to |
anyfp |
Last year of the output period. (Defaults to |
ndec |
Number of decimal places to be saved in the output file. |
suf |
Optional suffix to be added (by a hyphen) to the acronym of the variable to form the name of the input data. |
valm |
Monthly value to compute:
|
namax |
Maximum number of missing data in any month to compute its monthly value. (10 by default) |
na.strings |
Missing data code in the original daily data. |
homog |
If |
ini |
Initial date of the daily data, with format |
This function can be applied to either raw or homogenized daily data.
Raw data are read from files ‘VAR_YEAR-YEAR.dat’ and ‘VAR_YEAR-YEAR.est’, and monthly data will be saved to files ‘VAR-m_YEAR-YEAR.dat’ and ‘VAR-m_YEAR-YEAR.est’.
Homogenized data are read from ‘VAR_YEAR-YEAR.rda’. In this case monthly data will be saved to files named ‘VAR-mh_YEAR-YEAR.dat’ and ‘VAR-mh_YEAR-YEAR.est’.
This function does not return any value.
#Set a temporal working directory and write input files: wd <- tempdir() wd0 <- setwd(wd) data(Ttest) write(dat,'Ttest_1981-2000.dat') write.table(est.c,'Ttest_1981-2000.est',row.names=FALSE,col.names=FALSE) rm(dat,est.c) #remove loaded data from memory space #Now run the example: dd2m('Ttest',1981,2000) #Return to user's working directory: setwd(wd0) #Input and output files can be found in directory: print(wd)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.