Description Usage Arguments Value References See Also Examples
Constructs a query to the NaturalEarth server (ref 1) to download coastline data (or lake data, river data, etc) in any of three resolutions, and caches the resultant file.
1 2 3 4 5 6 7 8 9 10 |
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 |
server |
character value giving the base name of the server, used in the construction of URL queries. Since servers tend to change over time, this is a good argument to check, when debugging code that once worked but now fails. |
destdir |
character value indicating the directory in which to store
downloaded files. The default value of |
destfile |
character value indicating the name of the file. If not supplied, then the file name is constructed from the other parameters of the function call, so that subsequent calls with the same parameters will yield the same result; this is useful for caching. |
force |
A logical value that indicates whether to force the download,
even if the pathname constructed from |
dryrun |
A logical value that indicates whether to return the constructed web query, without attempting to download the file. This can be helpful in designing responses to changing URLs. |
debug |
an integer specifying whether debugging information is
to be printed during processing. The printing is done by
a call to |
A character value indicating the filename of the result; if there is a problem of any kind, the result will be the empty string.
The NaturalEarth server is at http://www.naturalearthdata.com
The work is done with utils::download.file()
.
The work is done with dc()
.
Other functions that download ocean-related data:
dc.g1sst()
,
dc.hydrography()
,
dc.met()
,
dc.topo()
,
dc.woa()
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
library(dc)
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 <- dc.coastline(destdir="~/data/coastline")
coastline <- read.coastline(filename)
plot(coastline)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.