Convert an object to a RMODFLOW array

Convert a rmf_list to a RMODFLOW array

rmf_as_array(...)

# S3 method for rmf_list
rmf_as_array(
  obj,
  dis,
  select = 4,
  na_value = 0,
  sparse = TRUE,
  kper = attr(obj, "kper"),
  fun = sum,
  ...
)

Arguments

...

additional arguments passed to fun.

obj

a rmf_list

dis

a RMODFLOW dis object

select

either a single integer or character specifying which column to select from the rmf_list. Defaults to the 4th column, i.e. the first variable.

na_value

value of the cells in the array which are not specified in obj; defaults to 0

sparse

logical; indicating if the returned array should be 2D or 3D. See details. Defaults to TRUE.

kper

sets the kper attribute of the returned array; defaults to the kper attribute of obj

fun

function to compute values in the case multiple values are defined for the same MODFLOW cell. Typically either mean or sum. Defaults to sum.

Value

either a rmf_2d_array or a rmf_3d_array

Details

the dimension of the returned array is guessed from the supplied dis object. If there is only one unique k value in obj, sparse, determines the dimensions of the returned array. If sparse = TRUE, a 2D array is returned. If sparse = FALSE, a 3D array is returned. When there is more than one unique k value in obj, a 3D array is always returned.

See also