View source: R/LPJmLData_subset.R
subset.LPJmLData | R Documentation |
Function to extract a subset of the full data in an LPJmLData
object by
applying selections along one or several of its dimensions.
## S3 method for class 'LPJmLData'
subset(x, ...)
x |
An LPJmLData object |
... |
One or several key-value combinations where keys represent the
dimension names and values represent the requested elements along these
dimensions. Subsets may either specify integer indices, e.g.
|
An LPJmLData
object with dimensions resulting from the selection
in subset
. Meta data are updated as well.
## Not run:
vegc <- read_io(filename = "./vegc.bin.json")
# Subset cells by index
subset(vegc, cell = seq(27410, 27415))
# [...]
# $data |>
# dimnames() |>
# .$cell "27409" "27410" "27411" "27412" "27413" "27414"
# .$time "1901-12-31" "1902-12-31" "1903-12-31" "1904-12-31" ...
# .$band "1"
# [...]
# Subset time by character vector
subset(vegc, time = c("2001-12-31", "2002-12-31", "2003-12-31"))
# [...]
# $data |>
# dimnames() |>
# .$cell "0" "1" "2" "3" ... "67419"
# .$time "2001-12-31" "2002-12-31" "2003-12-31"
# .$band "1"
# [...]
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.