Skip to content

Commit

Permalink
fix bug and tidy some code
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Aug 30, 2016
1 parent 699df9c commit 74f8b56
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions R/isd_stations_search.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@
#' isd_stations_search(bbox = bbox)
#' }
isd_stations_search <- function(lat = NULL, lon = NULL, radius = NULL, bbox = NULL) {
search_lat <- lat; search_lon <- lon
rm(lat, lon)
stations <- dplyr::filter_(
isd_stations(),
"!(is.na(lat) | is.na(lon) | (lat == 0 & lon == 0) | abs(lon) > 180 | abs(lat) > 90)"
Expand Down
4 changes: 2 additions & 2 deletions R/meteo_distance.R
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ meteo_spherical_distance <- function(lat1, long1, lat2, long2, units = 'deg') {
long1 <- deg2rad(long1)
lat2 <- deg2rad(lat2)
long2 <- deg2rad(long2)
} else if(units != 'rad'){
stop("The `units` argument must be `deg` or `rad`.")
} else if (units != 'rad') {
stop("The `units` argument must be `deg` or `rad`.", call. = FALSE)
}

# Determine distance using the haversine formula, assuming a spherical earth
Expand Down

0 comments on commit 74f8b56

Please sign in to comment.