MazamaLocationUtils (version 0.1.6)

table_save: Save a known location table

Description

Save a tibble of known locations to the preferred directory.

Usage

table_save(locationTbl = NULL, collectionName = NULL, backup = TRUE,
  outputType = "rda")

Arguments

locationTbl

Tibble of known locations, Default: NULL

collectionName

Character identifier for this table, Default: NULL

backup

Logical specifying whether to save a backup version of any existing tables sharing collectionName.

outputType

Output format, Default: 'rda'

Value

File path of saved file.

Details

Backup files are saved with "YYYY-mm-ddTHH:MM:SS"

Examples

Run this code
# NOT RUN {
# Set the directory for saving location tables
setLocationDataDir(tempdir())

# Load an example table and check the dimensions
locationTbl <- get(data("wa_monitors_500"))
dim(locationTbl)

# Save it as "table_save_example"
table_save(locationTbl, "table_save_example")

# Add a column and save again
locationTbl %>% 
  table_addColumn("my_column") %>% 
  table_save(locationTbl, "table_save_example")
  
# Check the locationDataDir
list.files(getLocationDataDir(), pattern = "table_save_example")
# }

Run the code above in your browser using DataLab