A new metadata column is added to the locationTbl
. For
matching locationID
records, the associated locationData
is
inserted. Otherwise, the new column will be initialized with NA
.
table_addColumn(
locationTbl = NULL,
columnName = NULL,
locationID = NULL,
locationData = NULL,
verbose = TRUE
)
Tibble of known locations.
Name to use for the new column.
Vector of locationID
strings.
Vector of data to used at matching records.
Logical controlling the generation of progress messages.
Updated tibble of known locations.
library(MazamaLocationUtils)
# Starting table
locationTbl <- get(data("wa_monitors_500"))
names(locationTbl)
#> [1] "locationID" "locationName" "longitude" "latitude" "elevation"
#> [6] "countryCode" "stateCode" "countyName" "timezone" "houseNumber"
#> [11] "street" "city" "postalCode"
# Add an empty column
locationTbl <-
locationTbl %>%
table_addColumn("AQSID")
names(locationTbl)
#> [1] "locationID" "locationName" "longitude" "latitude" "elevation"
#> [6] "countryCode" "stateCode" "countyName" "timezone" "houseNumber"
#> [11] "street" "city" "postalCode" "AQSID"