MazamaLocationUtils (version 0.4.3)

table_getRecordIndex: Return indexes of known location records

Description

Returns a vector of locationTbl row indexes for the locations associated with each locationID.

Usage

table_getRecordIndex(locationTbl = NULL, locationID = NULL, verbose = TRUE)

Value

Vector of locationTbl row indexes.

Arguments

locationTbl

Tibble of known locations.

locationID

Vector of locationID strings.

verbose

Logical controlling the generation of progress messages.

Examples

Run this code
library(MazamaLocationUtils)

locationTbl <- get(data("wa_monitors_500"))

# Wenatchee
lon <- -120.325278
lat <- 47.423333

# Get the locationID first
locationID <- table_getLocationID(locationTbl, lon, lat, distanceThreshold = 5000)

# Now find the row associated with this ID
recordIndex <- table_getRecordIndex(locationTbl, locationID)

str(locationTbl[recordIndex,])

Run the code above in your browser using DataLab