Skip to content

Commit

Permalink
fix: added 'na.rm = TRUE' to 'any(...)' calls
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathancallahan committed Sep 22, 2022
1 parent 9ec1df4 commit 9165b3e
Show file tree
Hide file tree
Showing 63 changed files with 78 additions and 65 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Type: Package
Package: MazamaLocationUtils
Version: 0.3.9
Version: 0.3.10
Title: Manage Spatial Metadata for Known Locations
Authors@R: c(
person("Jonathan", "Callahan", email="[email protected]", role=c("aut","cre")),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# MazamaLocationUtils 0.3.10

* Added `na.rm = TRUE` to all calls to `any(...)` in various `table_~()` functions.

# MazamaLocationUtils 0.3.9

* Updated `location_getSingleElevation_USGS()` to use the new web service at
Expand Down
2 changes: 1 addition & 1 deletion R/table_addLocation.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ table_addLocation <- function(
longitude <- longitude[!naMask]
latitude <- latitude[!naMask]

if ( verbose && any(naMask) ) {
if ( verbose && any(naMask, na.rm = TRUE) ) {
message(sprintf(
"%d of the %d requested locations have NA values",
length(which(naMask)), incomingCount
Expand Down
2 changes: 1 addition & 1 deletion R/table_getLocationID.R
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ table_getLocationID <- function(

for ( index in seq_len(nrow(myUniqueTbl)) ) {

if ( any(distance[,index] <= distanceThreshold) ) {
if ( any(distance[,index] <= distanceThreshold, na.rm = TRUE) ) {
row <- which(distance[,index] == min(distance[,index], na.rm = TRUE))
myUniqueTbl$locationID[index] <- locationTbl$locationID[row]
}
Expand Down
2 changes: 1 addition & 1 deletion R/table_getNearestDistance.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ table_getNearestDistance <- function(

for ( index in seq_len(nrow(myUniqueTbl)) ) {

if ( any(distance[,index] <= distanceThreshold) ) {
if ( any(distance[,index] <= distanceThreshold, na.rm = TRUE) ) {
myUniqueTbl$nearestDistance[index] <- min(distance[,index], na.rm = TRUE)
}

Expand Down
2 changes: 1 addition & 1 deletion R/table_getRecordIndex.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ table_getRecordIndex <- function(
for ( index in seq_along(locationID) ) {

if ( !is.na(locationID[index]) ) {
if ( any(locationTbl$locationID == locationID[index]) ) {
if ( any(locationTbl$locationID == locationID[index], na.rm = TRUE) ) {
recordIndex[index] <- which(locationTbl$locationID == locationID[index])
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/articles/MazamaLocationUtils.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ pkgdown: 1.6.1
pkgdown_sha: ~
articles:
MazamaLocationUtils: MazamaLocationUtils.html
last_built: 2022-09-21T21:50Z
last_built: 2022-09-22T18:28Z

2 changes: 1 addition & 1 deletion docs/reference/LocationDataDir.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/MazamaLocationUtils.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/coreMetadataNames.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/getAPIKey.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/getLocationDataDir.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/id_monitors_500.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/location_createID.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/location_getCensusBlock.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/location_getOpenCageInfo.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/location_getSingleAddress_Photon.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/location_getSingleAddress_TexasAM.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/location_getSingleElevation_USGS.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/location_initialize.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/mazama_initialize.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/or_monitors_500.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/pipe.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/setAPIKey.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/setLocationDataDir.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/showAPIKeys.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/table_addColumn.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/table_addCoreMetadata.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/table_addLocation.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/table_addOpenCageInfo.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/table_addSingleLocation.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/table_filterByDistance.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/table_findAdjacentDistances.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9165b3e

Please sign in to comment.