The metadata class is a thin wrapper around a nested list object. It provides a consistent start point to explore information about datasets and safely import them into R.

sal_get_metadata(x, prioritize_cache = TRUE,
  cache_dir = "~/salinasr-cache")

# S3 method for tbl_df
sal_get_metadata(x, prioritize_cache = TRUE,
  cache_dir = "~/salinasr-cache")

# S3 method for character
sal_get_metadata(dataset_id, prioritize_cache = TRUE,
  cache_dir = "~/salinasr-cache")

# S3 method for metadata
print(x, cache_dir = "~/salinasr-cache")

Arguments

x

character representing a dataset_id or tibble obtained via sal_get_dataset().

prioritize_cache

logical, whether to cache data locally to prevent redundant API calls.

cache_dir

character, path to read/write data.

dataset_id

character, ID used to identify dataset.

Value

metadata object

Methods (by class)

  • tbl_df: Method to obtain a metadata object from a tbl_df obtained from a metadata object in the event something occurred to the original metadata object.

  • character: Method to obtain a metadata object from a dataset_id.

  • metadata: Method to print metadata object. Empty metadata attributes are colored in red.

References

https://cityofsalinas.opendatasoft.com/explore/

Examples

library(salinasr) meta <- sal_get_metadata("bikeways") meta
#> dataset_id: bikeways #> metadata cache last modified: 2018-08-05 17:22:26 #> dataset cache last modified: 2018-08-05 17:15:10 #> metadata attributes: #> $attachments $links #> $attributions $metadata_processed #> $data_processed $modified #> $data_visible $oauth_scope #> $dataset_id $parent_domain #> $dataset_uid $publisher #> $description $records_count #> $features $references #> $fields $source_dataset #> $geographic_area $source_domain #> $geographic_area_mode $source_domain_address #> $has_records $source_domain_title #> $keyword $theme #> $language $title #> $license
meta$description
#> [1] "This layer depicts the different types of bike paths around the city of Salinas, CA, portions of South Monterey County, and the Monterey Peninsula. This data is useful for projects relating to planning, community development, traffic, engineering, and numerous others. The field titled 'class' describes the type of bike path: Class 1: Bike paths Class 2: Bike lane or Buffered Bike Lane Class 3: Bike routes, aka sharrows or shared-lane marking Class 4: Separated Bikeway Class 6: Unofficial Class 7: Unpaved Th is service was created by the GIS team in 2017. Its primary function is to act as a service for the online web maps that can be found on the Map Gallery within the City of Salinas website."