MazamaLocationUtils (version 0.1.6)

table_updateSingleRecord: Update a single known location record in a table

Description

Information in the locationList is used to replace existing information found in locationTbl. This function can be used for small tweaks to an existing locationTbl. Wholesale replacement of records should be performed with table_removeRecord() followed by table_addLocation().

Usage

table_updateSingleRecord(locationTbl = NULL, locationList = NULL,
  verbose = TRUE)

Arguments

locationTbl

Tibble of known locations, Default: NULL

locationList

List containing `locationID` and one or more named columns whose values are to be replaced, Default: NULL

verbose

Logical controlling the generation of progress messages.

Value

Updated tibble of known locations.

See Also

table_addLocation

table_addSingleLocation

table_removeRecord

Examples

Run this code
# NOT RUN {
locationTbl <- get(data("wa_monitors_500"))

# Wenatchee
wenatcheeRecord <- 
  locationTbl %>% 
  dplyr::filter(city == "Wenatchee")

str(wenatcheeRecord)

wenatcheeID <- wenatcheeRecord$locationID

locationTbl <- table_updateSingleRecord(
  locationTbl,
  locationList = list(
    locationID = wenatcheeID,
    locationName = "Wenatchee-Fifth St"
  )
)

# Look at the new record
locationTbl %>% 
  dplyr::filter(city == "Wenatchee") %>%
  str()

# }

Run the code above in your browser using DataLab