## Set a temporal working directory and write input files:
wd <- tempdir()
wd0 <- setwd(wd)
## Save example climatol input files:
load('~/cc/climatol/data/climatol_data.rda')
dat <- as.matrix(RR3st[,2:4])
write(dat,'Prec_1981-1995.dat')
write.table(SIstations,'Prec_1981-1995.est',row.names=FALSE,col.names=FALSE)
## Copy the provided simulated reanalysis series:
file.copy(exampleFiles('bogusERA5.txt'),'.')
## Now run the function. (Reanalysis precipitation rates in kg/m2/s
## are converted to mm with parameter b):
rean2climatol('Prec', 1981, 1995, 'bogusERA5.txt', 15, 46.2, datacol=c(2:4,1),
rname='bogusERA5', b=86400)
## Return to user's working directory:
setwd(wd0)
## New output files can be found in directory:
print(wd)
Run the code above in your browser using DataLab