id2shp: id2shp: Retrieve vector data given ID strings

Description Usage Arguments Details Value Functions See Also

View source: R/main.R

Description

This package downloads administrive boundaries and other vector data from Natural Earth and TIGER

Accepts a place code and returns an administrative boundary vector. This function will service place codes from rnaturalearth place names, Federal Information Processing Standard (FIPS) codes, and hierarchical administrative subdivision codes (HASC). If no names or codes are given, returns an extent for the globe in longitude/latitude.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
id2shp(
  country = NULL,
  hasc = NULL,
  fips = NULL,
  cb = TRUE,
  resolution = "20m",
  buffer = 0,
  returnclass = "sp",
  scale = "large",
  ...
)

Arguments

country

A country name identified in naturalearth country names

hasc

A HASC

fips

A FIPS code

cb

Logical. Applies only to FIPS codes. If true will return a generalized resolution cartographic boundary vector, otherwise returns a higher resolution vector. Default TRUE.

resolution

The resolution if cb is TRUE. Applies only with argument ‘FIPS’. Options are 500k, 5m, and 20m for 1:500k, 1:5 million, and 1:20 million.

buffer

Integer. If greater than zero will buffer the vector data to the value of this argument. Will not work with ‘returnclass’ set to 'sf'.

returnclass

set the class of the returned geometry. Accepts a value of either ‘sf’ or ‘sp’.

scale

The scale of the vector data. Applies only with arguments ‘country’ or ‘hasc’. Options are 'small', 'medium', or 'large'.

...

Additional arguments, unused.

Details

Vector data is downloaded using rnaturalearth (place names and HASC) or tigris (FIPS codes)

Value

A vector for the administrative boundary identified by the location code

Functions

id2shp

See Also

ne_countries ne_states counties countrycode


cmarmstrong/rv documentation built on Feb. 25, 2020, 12:50 a.m.