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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Oct 1 08:23:35 CEST 2013


Author: jaunario
Date: 2013-10-01 08:23:35 +0200 (Tue, 01 Oct 2013)
New Revision: 45

Modified:
   pkg/geoclimate/R/gsod.r
Log:
Solved GSOD.updateStations error on parsing getURL result in non-windows systems.

Modified: pkg/geoclimate/R/gsod.r
===================================================================
--- pkg/geoclimate/R/gsod.r	2013-10-01 06:13:06 UTC (rev 44)
+++ pkg/geoclimate/R/gsod.r	2013-10-01 06:23:35 UTC (rev 45)
@@ -39,7 +39,7 @@
 		show.message("Error: RCurl package not found.", appendLF=TRUE)		
 	} else {
 		show.message("Checking file date.", appendLF=TRUE)
-		online <-  unlist(strsplit(getURL("ftp://ftp.ncdc.noaa.gov/pub/data/inventories/"),"\r\n"))
+		online <-  unlist(strsplit(getURL("ftp://ftp.ncdc.noaa.gov/pub/data/inventories/"),ifelse(Sys.info()["sysname"]=="Windows","\r\n","\n")))
 		oinfo <- unlist(strsplit(online[grep("ISH-HISTORY.CSV$",online)],"[[:space:]]+"))
 		
 		age <- difftime(as.Date(paste(oinfo[6:7], collapse=" "), "%b %d"),file.info(system.file("gsod_stations.csv", package="geoclimate"))$ctime, units="weeks")



More information about the Rodbcext-commits mailing list