Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

datsubset

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)

climatol

Climate Tools (Series Homogenization and Derived Products)

v3.1.2
GPL (>= 2)
Authors
Jose A. Guijarro <jguijarrop@aemet.es>
Initial release
2019-08-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.