MazamaLocationUtils (version 0.1.6)

table_addColumn: Add a new column of metadata to a table

Description

A new metadata column is added to the locationTbl. For matching locationID records the assaociated locatioData is inserted. Otherwise, the new column will be initialized with NA.

Usage

table_addColumn(locationTbl = NULL, columnName = NULL,
  locationID = NULL, locationData = NULL, verbose = TRUE)

Arguments

locationTbl

Tibble of known locations, Default: NULL

columnName

Name to use for the new column, Default: NULL

locationID

Vector of locationID strings, Default: NULL

locationData

Vector of data to used at matching records, Default: NULL

verbose

Logical controlling the generation of progress messages.

Value

Updated tibble of known locations.

See Also

table_removeColumn

table_updateColumn

Examples

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

# Add an empty column
locationTbl <-
  locationTbl %>%
  table_addColumn("siteName")
  
names(locationTbl)
# }

Run the code above in your browser using DataLab