template_geographic_coverage: Describe where the data were collected

View source: R/template_geographic_coverage.R

template_geographic_coverageR Documentation

Describe where the data were collected

Description

Use this function to extract the unique location coordinates and names from a table or to create a blank template to manually fill.

Usage

template_geographic_coverage(
  path,
  data.path = path,
  data.table,
  lat.col,
  lon.col,
  site.col,
  empty = FALSE,
  write.file = TRUE,
  x = NULL
)

Arguments

path

(character) Path to the metadata template directory.

data.path

(character) Path to the data directory.

data.table

(character) Table name containing geographic coordinates.

lat.col

(character) Column name containing latitude coordinates in decimal degrees, where latitudes south of the equator are negative.

lon.col

(character) Column name containing longitude coordinates in decimal degrees, where longitudes west of the prime meridian are negative.

site.col

(character) Column name containing site names.

empty

(logical) Whether to write an empty template file.

write.file

(logical; optional) Whether to write the template file.

x

(named list; optional) Alternative input to template_geographical_coverage(). Use template_arguments() to create x.

Details

Character encoding of metadata extracted directly from the tables are converted to UTF-8 via enc2utf8().

Value

geographical_coverage

Columns:

  • geographicDescription: Brief description of location.

  • northBoundingCoordinate: North coordinate

  • southBoundingCoordinate: South coordinate

  • eastBoundingCoordinate: East coordinate

  • westBoundingCoordinate: West coordinate

Examples

## Not run: 
# Set working directory
setwd("/Users/me/Documents/data_packages/pkg_260")

# For a table containing site coordinates and names
template_geographic_coverage(
  path = "./metadata_templates",
  data.path = "./data_objects",
  data.table = "nitrogen.csv",
  site.col = "site_name",
  lat.col = "site_lat",
  lon.col = "site_lon")
  
# For returning an empty template to be filled manually
template_geographic_coverage(
  path = "./metadata_templates",
  empty = TRUE)

## End(Not run)


EDIorg/emlAssemblyLine documentation built on Nov. 4, 2022, 11:59 p.m.