Learn R Programming

climatol (version 3.1.2)

outrename: Rename homogen's output files

Description

This function inserts a suffix to the output file names of homogen, to prevent them from being rewritten by any further function run.

Usage

outrename(varcli, anyi, anyf, suffix, restore=FALSE)

Arguments

varcli

Acronym of the name of the studied climatic variable, as in the data file name.

anyi

Initial year of the study period

anyf

Final year of the study period

suffix

Suffix to be inserted (or removed) in the output file names.

restore

Set this parameter to TRUE to remove the suffix previously inserted by this function.

Value

This function does not return any value.

Details

The variable (or file base) name is separated from the appended suffix by a hyphen. The purpose of this function is to allow a new application of homogen to the same data with different parameters without overwriting the previous results.

See Also

homogen

Examples

Run this code
# NOT RUN {
#Set a temporal working directory and write input files:
wd <- tempdir()
wd0 <- setwd(wd)
data(Ptest)
dim(dat) <- c(720,20)
dat[601:720,5] <- dat[601:720,5]*1.8
write(dat[481:720,1:5],'pcp_1991-2010.dat')
write.table(est.c[1:5,1:5],'pcp_1991-2010.est',row.names=FALSE,col.names=FALSE)
homogen('pcp',1991,2010,std=2) #homogenization
#Now run the example:
outrename('pcp',1991,2010,'ok')
#Return to user's working directory:
setwd(wd0)
#Input and output files can be found in directory:
print(wd)
# }

Run the code above in your browser using DataLab