## Set a temporal working directory:
wd <- tempdir()
wd0 <- setwd(wd)
## Create origin and destination directories and copy example input files:
dir.create('dir1'); dir.create('dir2')
file.copy(exampleFiles('p064.xlsx'),'dir1')
file.copy(exampleFiles('p082.xlsx'),'dir1')
file.copy(exampleFiles('p084.xlsx'),'dir1')
## Create input files for csv2climatol with the function xls2csv:
xls2csv('dir1','dir2','RR')
## Add bogus coordinates and elevations to the station file:
est=read.table('xls_RR_stations.csv',sep=',')
est=data.frame(1:3,21:23,101:103,est)
write.table(est,'xls_RR_stations.csv',sep=',',row.names=FALSE,col.names=FALSE)
## Now run the example of csv2climatol:
csv2climatol('xls_RR_data.csv', datacol=1:5, stnfile='xls_RR_stations.csv',
varcli='RR',header=FALSE)
## 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