Learn R Programming

IsoriX (version 0.7)

prepcipitate: Prepare the raster brick containing the precipitation data

Description

This functions turns the WorldClim data downloaded using the function getprecip into a RasterBrick of same resolution and extent as the elevation raster. This function is designed to be used with isomultiscape.

Usage

prepcipitate(path = NULL, elevation.raster, verbose = interactive())

Arguments

path

A string indicating the path where the WorldClim data have been downloaded. If the path is null (the default) the function will assume that the folder containing the precipitation data is in the current directory

elevation.raster

A raster containing the elevation raster

verbose

A logical indicating whether information about the progress of the procedure should be displayed or not while the function is running. By default verbose is TRUE if users use an interactive R session, and FALSE otherwise.

See Also

getprecip to download the relevant precipitation data

relevate to prepare the elevation raster

Examples

Run this code
# NOT RUN {
## The following example takes some time and download heavy data.
## It will therefore not be run unless you type: 
## example(prepcipitate, run.dontrun = TRUE)

# }
# NOT RUN {
## We fit the models for Germany:
GNIPDataDEagg <- prepdata(data = GNIPDataDE)

GermanFit <- isofit(iso.data = GNIPDataDEagg,
                    mean.model.fix = list(elev = TRUE, lat.abs = TRUE))

elevation.raster <- relevate(
    elevation.raster = ElevRasterDE,
    isofit = GermanFit,
    aggregation.factor = 0)

getprecip(path = "~/Desktop/")

precipitation.brick <- prepcipitate(path = "~/Desktop/",
                                    elevation.raster = ElevRaster
                                    )
 
 if (require(rasterVis)) {
   levelplot(precipitation.brick)
 }

# }

Run the code above in your browser using DataLab