make_raster: Convenience function to make a RasterStack

View source: R/make_raster.R

make_rasterR Documentation

Convenience function to make a RasterStack

Description

Convenience function to make a RasterStack

Usage

make_raster(x, ...)

Arguments

x

Vector or list of file paths

...

Further args passed on to stack

Value

An object of RasterStack-class

See Also

stack

Examples

## Not run: 
zip <- system.file("examples", "prismrain.zip", package = "timeraster")
dir <- paste0(tempdir(), "/prismrain")
dir <- "prismrain"
dir.create(dir)
unzip(zip, exdir = dir)
files <- list.files(dir, full.names = TRUE, pattern = ".tif$", all.files = TRUE)

# Create raster stack from file paths
res <- make_raster(files)

# NetCDF
x <- "/Users/sacmac/Downloads/lfndx_Ayear_PRISM_historical_v0_2014-2014.nc"
res <- make_raster(x)

## End(Not run)

ropenscilabs/timeraster documentation built on May 18, 2022, 8:33 p.m.