filter_obs | R Documentation |
Filter observation list to exclude situations, variables or dates
filter_obs(
obs_list,
var = NULL,
situation = NULL,
dates = NULL,
include = FALSE,
var_names = lifecycle::deprecated(),
sit_names = lifecycle::deprecated()
)
obs_list |
List of observed values to use for parameter estimation.
A |
var |
(optional, if not given all variables will be kept) Vector containing the names of the variables to include or exclude |
situation |
(optional, if not given all situations will be kept) Vector containing the names of the situations to include or exclude |
dates |
(optional, if not given all dates will be kept) Vector containing the dates (POSIXct format) to include or exclude |
include |
(optional, FALSE by default) Flag indicating if the variables / situations / dates listed in inputs must be included (TRUE) or not (FALSE) in the resulting list |
var_names |
|
sit_names |
obs_list List of filtered observed values (same format as obs_list
input argument)
For more detail and examples, see the different vignettes in CroptimizR website
obs_list <- list(
sit1 = data.frame(
Date = as.POSIXct(c("2009-11-30", "2009-12-10")),
var1 = c(1.1, 1.5), var2 = c(NA, 2.1)
),
sit2 = data.frame(
Date = as.POSIXct(c("2009-11-30", "2009-12-5")),
var1 = c(1.3, 2)
)
)
# Keep only var1
filter_obs(obs_list, var = c("var1"), include = TRUE)
# Exclude observations at date "2009-11-30"
filter_obs(obs_list, dates = as.POSIXct(c("2009-11-30")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.