Learn R Programming

soilDB (version 2.7.1)

createSSURGO: Create a SQLite database or GeoPackage from one or more SSURGO Exports

Description

Create a SQLite database or GeoPackage from one or more SSURGO Exports

Usage

createSSURGO(
  filename,
  exdir,
  pattern = NULL,
  overwrite = FALSE,
  header = FALSE,
  ...
)

Arguments

filename

Output file name (e.g. 'db.sqlite' or 'db.gpkg')

exdir

Path containing containing SSURGO spatial (.shp) and tabular (.txt) files.

pattern

Character. Optional regular expression to use to filter subdirectories of exdir. Default: NULL will search all subdirectories for SSURGO export files.#' @param include_spatial Logical. Include spatial data layers in database? Default: TRUE.

overwrite

Logical. Overwrite existing layers? Default FALSE will append to existing tables/layers.

header

Logical. Passed to read.delim() for reading pipe-delimited (|) text files containing tabular data.

...

Additional arguments passed to write_sf() for writing spatial layers.

Value

Character. Vector of layer/table names in filename.

Examples

Run this code
# NOT RUN {
 downloadSSURGO("areasymbol IN ('CA067', 'CA077', 'CA632')", destdir = "SSURGO_test")
 createSSURGO("test.gpkg", "SSURGO_test")
# }

Run the code above in your browser using DataLab