tile_merge: Merge worldclim data.

Description Usage Arguments Details Value Author(s) Examples

View source: R/tile_merge.R

Description

This function merges tiles downloaded from WorldClim into a single raster.

Usage

1
tile_merge(tiles, fac)

Arguments

tiles

List with 0.5 arc min WorldClim tile stacks (or single rasters) (i.e. produced by tile_get). Names and number of variables need to match between stacks.

fac

Factor by which resolution is changed, see details.

Details

raster::merge is used for merging, at default settings. That means that in case of overlaps the cell values of the object that comes first in the sequence are retained. Raster resolution can be changed to speed up merging of very high resolution data. For example, when data are SRTM tiles, fac = 10 will resample to a resolution of 0.5 arcmin (bilinear), which corresponds to the resolution of WorldClim data.

Value

RasterStack or Raster containing merged WorldClim variable(s).

Author(s)

Simon Kapitza simon.statecology@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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

wcmerged <- tile_merge(wctiles)
srtmmerged <- tile_merge(srtmtiles)
srtmmerged <- tile_merge(srtmtiles, fac = 10)

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