## Set a temporal working directory:
wd <- tempdir()
wd0 <- setwd(wd)
## Prepare a few files in RClimDex/RClimPACT format:
data(climatol_data)
df=data.frame(File=c('p064.txt','p084.txt','p082.txt'),Lat=SIstations$Y,
Lon=SIstations$X,Elev=SIstations$Z,name=SIstations$Name)
write.table(df,'stations.txt',sep='\t',row.names=FALSE)
write.table(p064.df,'p064.txt',sep='\t',row.names=FALSE,quote=FALSE)
write.table(p084.df,'p084.txt',sep='\t',row.names=FALSE,quote=FALSE)
write.table(p082.df,'p082.txt',sep='\t',row.names=FALSE,quote=FALSE)
## Now run the example:
rclimdex2climatol('stations.txt',3)
## 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