rmf_as_raster | R Documentation |
Functions to convert rmf_array and rmf_list objects to raster objects
rmf_as_raster(...) ## S3 method for class 'rmf_2d_array' rmf_as_raster(array, dis, prj = rmf_get_prj(dis), ...) ## S3 method for class 'rmf_3d_array' rmf_as_raster(array, dis, prj = rmf_get_prj(dis), ...) ## S3 method for class 'rmf_4d_array' rmf_as_raster(array, dis, l = NULL, prj = rmf_get_prj(dis), ...) ## S3 method for class 'rmf_list' rmf_as_raster(obj, dis, select, prj = rmf_get_prj(dis), ...)
... |
additional arguments passed to |
array |
|
dis |
|
prj |
|
l |
integer specifying which dimension of a 4d array to convert to raster. |
obj |
|
select |
integer or character specifying which column of the |
the objects are first converted to stars
using rmf_as_stars
.
Conversions to raster
objects will fail when arrays are rectilinear or rotated.
an object of class RasterLayer
if array is 2d, or RasterBrick
when array is 3d or 4d with the bands representing the MODFLOW layers.
The variable values are obtained from the array or from the select
column for rmf_list
objects.
rmf_as_stars
dis <- rmf_create_dis() # 2d array r <- rmf_create_array(1:prod(dis$nrow, dis$ncol), dim = c(dis$nrow, dis$ncol)) rmf_as_raster(r, dis = dis) # 3d array r <- rmf_create_array(1:prod(dis$nrow, dis$ncol, dis$nlay), dim = c(dis$nrow, dis$ncol, dis$nlay)) rmf_as_raster(r, dis = dis, id = 'modflow') # 4d array r <- rmf_create_array(1:prod(dis$nrow, dis$ncol, dis$nlay, 2), dim = c(dis$nrow, dis$ncol, dis$nlay, 2)) rmf_as_raster(r, dis = dis, l = 2) # rmf_list l <- rmf_create_list(data.frame(i = 1, j = 1:2, k = c(2, 2), q = c(-500, -400), d = 35)) rmf_as_raster(l, dis = dis, select = 'q') # rotated grids can not be converted to raster ## Not run: prj <- rmf_create_prj(rotation = 12) rmf_as_raster(r, dis = dis, l = 2, prj = prj) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.