library(MazamaLocationUtils)
# Starting table
locationTbl <- get(data("wa_monitors_500"))
names(locationTbl)
# Add a new column
locationTbl <-
locationTbl %>%
table_addColumn("AQSID")
names(locationTbl)
# Now remove it
locationTbl <-
locationTbl %>%
table_removeColumn("AQSID")
names(locationTbl)
try({
# Cannot remove "core" metadata
locationTbl <-
locationTbl %>%
table_removeColumn("longitude")
}, silent = FALSE)
Run the code above in your browser using DataLab