datsubset {climatol}R Documentation

Subset Climatol input data into new files

Description

This function allows saving a subset of Climatol input data into new input files, by selecting a subperiod and/or series with a minimum number of years with data.

Usage

datsubset(varcli, anyi, anyf, anyis=anyi, anyfs=anyf, minny=NA)

Arguments

varcli

Acronym of the name of the studied climatic variable.

anyi

Initial year of the data present in the file.

anyf

Final year of the data present in the file.

anyis

First year of the output subperiod. (Defaults to anyi).

anyfs

Last year of the output subperiod. (Defaults to anyf).

minny

Minimum number of years with data to retain the series.

Details

Climatol homogenization requires that no time step be totally void of data in all stations simultaneously. This function allows subsetting already existing Climatol input files by selecting a subperiod and/or stations with a minimum number of years with data (may contain gaps).

Value

This function does not return any value.

Examples

#Set a temporal working directory and write input files:
wd <- tempdir()
wd0 <- setwd(wd)
data(Ptest)
write(dat,'Ptest_1951-2010.dat')
write.table(est.c, 'Ptest_1951-2010.est', row.names=FALSE, col.names=FALSE)
rm(dat,est.c) #remove loaded data from memory space
datsubset('Ptest',1951,2010,1971,2000,20)
#Return to user's working directory:
setwd(wd0)
#Input and output files can be found in directory:
print(wd)

[Package climatol version 3.1.2 Index]