[Rodbcext-commits] r54 - pkg/geoclimate/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jun 24 05:25:01 CEST 2014


Author: jaunario
Date: 2014-06-24 05:25:01 +0200 (Tue, 24 Jun 2014)
New Revision: 54

Modified:
   pkg/geoclimate/R/source-nasa.r
Log:
Fixed width numbers in NASA filenames.

Modified: pkg/geoclimate/R/source-nasa.r
===================================================================
--- pkg/geoclimate/R/source-nasa.r	2014-04-11 08:20:59 UTC (rev 53)
+++ pkg/geoclimate/R/source-nasa.r	2014-06-24 03:25:01 UTC (rev 54)
@@ -28,7 +28,7 @@
 	stdate <- as.Date(stdate)
 	endate <- as.Date(endate)
 	
-	fname <- paste(paste("nasa",cell,x,y,format(stdate,"%Y.%m.%d"),format(endate,"%Y.%m.%d"), sep="_"), ".txt",sep="")
+	fname <- paste(paste("nasa",sprintf("%06i",cell),sprintf("%05.1f",x),sprintf("%05.1f",y),format(stdate,"%Y.%m.%d"),format(endate,"%Y.%m.%d"), sep="_"), ".txt",sep="")
 	#dlurl <- paste("http://earth-www.larc.nasa.gov/cgi-bin/cgiwrap/solar/agro.cgi?email=agroclim%40larc.nasa.gov&step=1&lat=",y,"&lon=",x,"&ms=",format(stdate,"%m"),"&ds=",format(stdate,"%d"),"&ys=",format(stdate,"%Y"),"&me=",format(endate,"%m"),"&de=",format(endate,"%d"),"&ye=",format(endate,"%Y"),"&p=swv_dwn&p=T2M&p=T2MN&p=T2MX&p=RH2M&p=DFP2M&p=RAIN&p=WS10M&submit=Submit", sep="")
 	dlurl <- paste("http://power.larc.nasa.gov/cgi-bin/cgiwrap/solar/agro.cgi?email=agroclim%40larc.nasa.gov&step=1&lat=",y,"&lon=",x,"&ms=",monthFromDate(stdate),"&ds=",dayFromDate(stdate),"&ys=",yearFromDate(stdate),"&me=",monthFromDate(endate),"&de=",dayFromDate(endate),"&ye=",yearFromDate(endate),"&p=", paste(vars,collapse="&p=",sep=""),"&submit=Submit", sep="")
 	



More information about the Rodbcext-commits mailing list