Description Usage Arguments Details Value See Also Examples
This function can be useful to prepare the Climatol input files when the user have their daily data in RClimDex format.
1 2 |
stfile |
Name of the file with the list of data file names and station coordinates, codes and names (in HOMER format). |
kvar |
RClimDex variable to extract: 1(RR), 2(TX), 3(TN). |
varcli |
Acronym of the name of the studied climatic variable. |
chrcod |
Initial and final characters of data file names to be used as station codes. (Between the sixth and the tenth by default.) |
anyi |
First year to study. (Defaults to the first year of available data.) |
anyf |
Last year to study. (Defaults to the last year of available data.) |
mis |
Missing data code. (Defaults to -99.9.) |
mindat |
Minimum required number of data per station. (Defaults to 365 daily data.) |
names |
Are there a 9th column with the station names? ( |
Users of the RClimDex program can convert their daily data files to the Climatol format. All files listed in stfile
will be read, and the selected variable (precipitation, maximum or minimum temperature) will be stored in a unique *.dat file, with its companion *.est station file. Therefore, if you want to convert all three variables, you must run this function three times.
This function does not return any value.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #Set a temporal working directory and write input files:
wd <- tempdir()
wd0 <- setwd(wd)
data(rclimdex)
write.table(rcxsta,'stations.txt',sep='\t',row.names=FALSE,col.names=FALSE,
quote=FALSE)
write.table(df1,'raxxd000WY003d.txt',row.names=FALSE,col.names=FALSE)
write.table(df2,'raxxd000WY018d.txt',row.names=FALSE,col.names=FALSE)
write.table(df3,'raxxd000WY020d.txt',row.names=FALSE,col.names=FALSE)
#Now run the examples:
rclimdex2climatol('stations.txt',1,'RR',c(9,13))
rclimdex2climatol('stations.txt',2,'TX',c(9,13))
rclimdex2climatol('stations.txt',3,'TN',c(9,13))
#Return to user's working directory:
setwd(wd0)
#Input and output files can be found in directory:
print(wd)
|
Loading required package: maps
Loading required package: mapdata
Generating RR Climatol input files from RClimDex files...:
raxxd000WY003d.txt
raxxd000WY018d.txt
raxxd000WY020d.txt
Data from 1981-01-01 to 2000-12-31 saved to file RR_1981-2000.dat
The longest period without concurrent missing data in all stations
goes from 1987-01-16 to 1995-05-26
Station coordinates and names saved to file RR_1981-2000.est
Generating TX Climatol input files from RClimDex files...:
raxxd000WY003d.txt
raxxd000WY018d.txt
raxxd000WY020d.txt
Data from 1981-01-01 to 2000-12-31 saved to file TX_1981-2000.dat
The longest period without concurrent missing data in all stations
goes from 1987-01-16 to 1995-05-26
Station coordinates and names saved to file TX_1981-2000.est
Generating TN Climatol input files from RClimDex files...:
raxxd000WY003d.txt
raxxd000WY018d.txt
raxxd000WY020d.txt
Data from 1981-01-01 to 2000-12-31 saved to file TN_1981-2000.dat
The longest period without concurrent missing data in all stations
goes from 1987-01-16 to 1995-05-26
Station coordinates and names saved to file TN_1981-2000.est
[1] "/work/tmp/tmp/RtmpsPBdZ4"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.