| make_brick | R Documentation |
Convenience function to make a RasterBrick
make_brick(x, ...)
x |
A file path, or a URL to a file |
... |
Further args passed on to |
An object of RasterBrick-class
brick
## 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_brick(files[1])
# native if TRUE uses raster package, if FALSE uses rgdal
make_brick(files[1], native = FALSE)
make_brick(files[1], native = TRUE)
# from a NetCDF file
## dates available
url <- "ftp://ftp.cdc.noaa.gov/Datasets/noaa.oisst.v2.highres/sst.day.mean.2016.v2.nc"
tf <- tempfile(fileext = ".nc")
download.file(url, tf, mode = 'wb')
x <- make_brick(tf)
time_raster(x)
nc <- system.file("examples", "prismrain.nc", package = "timeraster")
make_brick(nc)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.