tile_get: Download WorldClim and SRTM data.

Description Usage Arguments Value Author(s) Examples

View source: R/tile_get.R

Description

This function is a wrapper for raster::getData. Provide a character vector with tile names for either WorldClim 0.5 arcmin or SRTM 90m and those tiles will be downloaded.

Usage

1
tile_get(tiles, var, path, name = "worldclim")

Arguments

tiles

Character vector. Contains WorldClim (0.5 arcmin) or SRTM (90m) tile names. Tile names can be determined with tile_name().

var

Character. Which worldclim variable? Valid values are 'tmin', 'tmax', 'prec' and 'bio'.

path

target path where data is downloaded.

name

Valid values are 'worldclim' and 'srtm'. Default is 'worldclim'. If name = 'worldclim', var has to be specified.

Value

raster object containing list of worldclim tiles.

Author(s)

Simon Kapitza simon.statecology@gmail.com

Examples

1
2
3
4
5
6
7
boundary <- getData("GADM", country = "FRA", level = 0) #Downloads France boundaries

tilenames <- tile_name(boundary, name = 'worldclim') #Determines names of the worldclim tiles covering France
srtmtilenames <- tile_name(boundary, name = 'srtm') #Determines names of the srtm tiles covering France

wctiles <- tile_get(tiles = tilenames, name = 'srtm', var = "bio") #downloads WorldClim tiles covering France
srtmtiles <- tile_get(tiles = srtmtilenames, name = 'srtm') #downloads SRTM tiles covering France

kapitzas/WorldClimTiles documentation built on July 13, 2021, 4:51 p.m.