climatol2rclimdex | R Documentation |
climatol
to RClimDEX/RClimPACT input
formatThis function reads homogenized daily series of precipitation (RR) and extreme temperatures (TX, TN), adjusted from the last homogeneous sub-period, and writes them in files (one per station) with RClimDEX format.
climatol2rclimdex(varRR, varTX, varTN, yiRR, yfRR, yiTX=yiRR, yfTX=yfRR,
yiTN=yiRR, yfTN=yfRR, header=TRUE, prefix='hoclm', dir=NA, na='-99.9')
varRR , varTX , varTN |
Name of the variables in the |
yiRR , yfRR |
Initial and final years of the homogenized RR series. |
yiTX , yfTX , yiTN , yfTN |
Initial and final years of the TX and TN series. (The same as yiRR and yfRR by default.) |
header |
include a header in the files? ( |
prefix |
Prefix to prepend to station codes to name the output RClimDEX files. |
dir |
Destination directory of the output RClimDEX files. (If not set, they will be saved into the current R working directory). |
na |
Missing data code to use in the ouput files. ( |
After homogenizing daily series with climatol
, the user may be
interested in applying the RClimDEX or RClimPACT/RClimPACTs programs to the
homogenized series. This function automatizes the conversion between both file
formats.
Note that if there are some days with TX<TN (can happen because of the independent homogenization of extreme temperatures), a trivial fix will be applied by just exchanging the problem values.
homogen
## Set a temporal working directory and generate input files:
wd <- tempdir()
wd0 <- setwd(wd)
## copy example daily RR, TX and TN homogenization results:
file.copy(exampleFiles('RR_1981-1995.rda'),'.')
file.copy(exampleFiles('TX_1981-1995.rda'),'.')
file.copy(exampleFiles('TN_1981-1995.rda'),'.')
## Now run the example:
climatol2rclimdex('RR','TX','TN',1981,1995)
## Return to user's working directory:
setwd(wd0)
## Input and output files can be found in directory:
print(wd)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.