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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed May 30 02:59:05 CEST 2012


Author: jaunario
Date: 2012-05-30 02:59:05 +0200 (Wed, 30 May 2012)
New Revision: 22

Modified:
   pkg/geoclimate/R/gsod.r
Log:
Added filter on no longitude for option nocoords in GSOD.readStations

Modified: pkg/geoclimate/R/gsod.r
===================================================================
--- pkg/geoclimate/R/gsod.r	2012-05-18 09:48:56 UTC (rev 21)
+++ pkg/geoclimate/R/gsod.r	2012-05-30 00:59:05 UTC (rev 22)
@@ -12,7 +12,10 @@
     show.message("Reading GSOD station info file.", appendLF=TRUE)					
     stations <- read.csv(stationfile, stringsAsFactors=FALSE)
     if(rm.nodata) stations <- stations[-which(is.na(stations$BEGIN)),]
-    if(rm.nocoords) stations <- stations[-which(stations$LAT==-99999|is.na(stations$LAT)),]
+    if(rm.nocoords) {
+		stations <- stations[-which(stations$LAT==-99999|is.na(stations$LAT)),]
+		stations <- stations[-which(stations$LON==-99999|is.na(stations$LON)),]
+	}
     stationid <- paste(sprintf("%06d",stations$USAF), sprintf("%05d", stations$WBAN), sep="-")
     stations <- cbind(stationid,stations, stringsAsFactors=FALSE)
     



More information about the Rodbcext-commits mailing list