Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

check_data_exist

check whether the requested data exist on Natural Earth


Description

checks from a list dependent on type, category and scale. If it returns FALSE the data may still exist on the website. Doesn't yet do checking on raster names because I found the naming convention too tricky.

Usage

check_data_exist(scale = 110, type, category = c("cultural", "physical",
  "raster"))

Arguments

scale

scale of map to return, one of 110, 50, 10 or 'small', 'medium', 'large'

type

type of natural earth file to download one of 'countries', 'map_units', 'map_subunits', 'sovereignty', 'states' OR the portion of any natural earth vector url after the scale and before the . e.g. for 'ne_50m_urban_areas.zip' this would be 'urban_areas' OR the raster filename e.g. for 'MSR_50M.zip' this would be 'MSR_50M'

category

one of natural earth categories : 'cultural', 'physical', 'raster'

Value

TRUE or FALSE

Examples

check_data_exist( scale = 110, category = 'cultural', type = 'countries' )
# type not in list for this category
check_data_exist( scale = 110, category = 'physical', type = 'airports' )
# type in list but scale shows FALSE
check_data_exist( scale = 110, category = 'cultural', type = 'airports' )

rnaturalearth

World Map Data from Natural Earth

v0.1.0
MIT + file LICENSE
Authors
Andy South [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.