download.coastline | R Documentation |
Constructs a query to the NaturalEarth server (see reference 1) to download coastline data (or lake data, river data, etc) in any of three resolutions.
download.coastline(
resolution,
item = "coastline",
destdir = ".",
destfile,
server = "naturalearth",
debug = getOption("oceDebug")
)
resolution |
A character value specifying the desired resolution. The permitted
choices are |
item |
A character value indicating the quantity to be downloaded.
This is normally one of |
destdir |
Optional string indicating the directory in which to store
downloaded files. If not supplied, |
destfile |
Optional string indicating the name of the file. If not supplied, the file name is constructed from the other parameters of the function call, so subsequent calls with the same parameters will yield the same result, thus providing the key to the caching scheme. |
server |
A character value specifying the server that is to supply
the data. At the moment, the only permitted value is |
debug |
an integer specifying whether debugging information is
to be printed during the processing. This is a general parameter that
is used by many |
A character value indicating the filename of the result; if there is a problem of any kind, the result will be the empty string.
library(oce) # User must create directory ~/data/coastline first. # As of September 2016, the downloaded file, named # "ne_50m_coastline.zip", occupies 443K bytes. filename <- download.coastline(destdir="~/data/coastline") coastline <- read.coastline(filename) plot(coastline)
Dan Kelley
The NaturalEarth server is at https://www.naturalearthdata.com
The work is done with utils::download.file()
.
Other functions that download files:
download.amsr()
,
download.met()
,
download.topo()
Other things related to coastline data:
[[,coastline-method
,
[[<-,coastline-method
,
as.coastline()
,
coastline-class
,
coastlineBest()
,
coastlineCut()
,
coastlineWorld
,
plot,coastline-method
,
read.coastline.openstreetmap()
,
read.coastline.shapefile()
,
subset,coastline-method
,
summary,coastline-method
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.