View source: R/derived-data-prep.R
exclude_rows | R Documentation |
A mechanism for excluding outliers during data cleaning. Create exploratory
plots, identify rows of the dataset to be considered outliers for exclusion,
and then feed that filtered dataset into this function to exclude them from
the dataset. Requires a corresponding IGNORE
statement - see argument
descriptions for more details.
exclude_rows(d, dexcl, exclude_col = "EXCL")
d |
A |
dexcl |
A smaller |
exclude_col |
Character (default = |
A modified version of d
with exclude_col
set to 1
for rows
coinciding with dexcl
.
read_derived_data()
, write_derived_data()
# create example object m1 from package demo files exdir <- system.file("extdata", "examples", "theopp", package = "NMproject") m1 <- new_nm(run_id = "m1", based_on = file.path(exdir, "Models", "ADVAN2.mod"), data_path = file.path(exdir, "SourceData", "THEOPP.csv")) d <- input_data(m1) d$EXCL <- 0 ## start with no rows excluded ## use with dplyr dexcl <- d %>% dplyr::filter(ID == 6, TIME > 3) %>% dplyr::select(ID, TIME, DV, EXCL) dexcl ## view rows to be excluded d <- d %>% exclude_rows(dexcl) d %>% dplyr::filter(ID %in% 6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.