Description Usage Arguments Details Examples
View source: R/ff_raster_create.R
Use a raster template to set up an ff array for filling.
1 |
x |
a raster object, used as the template for the data to come |
nlayers |
the number of layers to instantiate |
filename |
the .grd filename |
... |
arguments passed to .writeGRD |
setZ |
optional z values, must be of length 'nlayers' |
Note that no data is transferred, this is a set up function to give an ff array to be populated.
There is currently no control over the bandorder, set to band interleaved (BIL) currently.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
n <- 5
files <- raadtools::sstfiles()[1:n, ]
library(raster)
fun <- function(date) raadtools::readsst(date, xylim = extent(120, 160, -50, -30), inputfiles = files)
arr <- ff_raster(fun(files$date[1]), nlayers = n, filename = "afile.grd", overwrite = TRUE)
for (i in seq_along(files$date)) {
arr[,,i] <- raster::values(t(fun(files$date[i])))
}
# plot(brick("afile.grd"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.