download.file _cannot open destfile

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

download.file _cannot open destfile

SantoshK
I am a beginner in R. My script is:
rm(list=ls())
output_folder <-"X:\\My_R_result\\"
url<-paste("https://climexp.knmi.nl/data/icmip5_pr_Amon_ens_rcp45_79-91E_26- 
31N_n_su_001.dat",sep="")
destfile<-paste(output_folder,"001.dat",sep="")
download.file(url,destfile,method="auto",quiet = FALSE, mode="W",cacheOK=TRUE)
print(download.file)
print("finished")

It pop ups with Error in download.file(url, destfile, method = "auto", quiet = FALSE, : cannot open destfile 'X:\My_R_result\001.dat', reason 'Invalid argument' Could you please tell me whats wrong here??
Thank you.