dahstat {climatol} | R Documentation |
Extract series or statistics of the homogenized data
Description
Lists series, means, medians, standard deviations, quantiles or trends, for a
specified period, from series homogenized by homogen
.
Usage
dahstat(varcli, anyi, anyf, anyip=anyi, anyfp=anyf, stat="me", ndc=NA, vala=2,
valm=vala, cod=NULL, prob=.5, all=FALSE, long=FALSE, relref=FALSE, pernyr=10,
estcol=c(1,2,4), sep=',', dec='.')
Arguments
varcli |
Short name of the studied climatic variable, as in the data file name. |
anyi |
Initial year of the homogenized period. |
anyf |
Final year of the homogenized period. |
anyip |
First year of the period to analyze. (Defaults to |
anyfp |
Last year of the period to analyze. (Defaults to |
stat |
Statistical parameter to compute for the selected period:
|
ndc |
Number of decimal places to be saved in the output file (defaults to that used in the homogenization). |
vala |
Annual values to compute from the sub-annual data:
|
valm |
Monthly values to calculate from sub-monthly data (defaults to
|
cod |
Vector of requested station codes (all by default). |
prob |
Probability for the computation of quantiles (0.5 by default, i.e., medians). You can set probabilities with more than 2 decimals, but the name of the output file will be identified with the rounded percentile. |
all |
If |
long |
If |
relref |
If |
pernyr |
Number of years on which to express trend units (10 by default). |
estcol |
Columns of the homogenized stations file to be included in the output file. (Defaults to c(1,2,4), the columns of station coordinates and codes). |
sep |
Field separator (',' by default). |
dec |
Decimal point ('.' by default). |
Details
Homogenized data are read from the file ‘VRB_ANYI-ANYF.rda’
saved by homogen
, while this function saves the
computed data for the specified period in ‘VRB_ANYIP-ANYFP.STAT’,
where STAT
is substituted by the stat
requested
statistic. An exception is when stat="q"
, since then the
extension of the output file will be qPP
, where PP
stands for the specified prob
probability (in percent).
The output period ANYIP-ANYFP
must of course be comprised
within the period of the input data, ANYI-ANYF
.
stat='tnd'
computes trends by Ordinary Least Squares linear regression
on time, listing them in a CSV file ‘*_tnd.csv’ and their p-values in
‘*_pval.csv’
If stat='series'
is chosen, two text files in CSV format will be
produced for every station, one with the data and another with their flags: 0
for original, 1 for infilled and 2 for corrected data.
See Also
Examples
## Set a temporal working directory:
wd <- tempdir()
wd0 <- setwd(wd)
## Copy an example file of homogenization results:
file.copy(exampleFiles('Temp_1991-2000.rda'),'.')
## Now run the examples:
dahstat('Temp', 1991, 2000)
dahstat('Temp', 1991, 2000, stat='q', prob=0.4)
dahstat('Temp', 1991, 2000, stat='tnd')
dahstat('Temp', 1991, 2000, stat='series')
## Return to user's working directory:
setwd(wd0)
## Input and output files can be found in directory:
print(wd)