# 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)
Run the code above in your browser using DataLab