[Stable]

Uses data_path field of object to locate data and read in.

input_data(m, filter = FALSE, na = ".", ...)

Arguments

m

An nm object.

filter

Logical (default = FALSE). Applies NONMEM ignore statement to filter dataset.

na

Character. Passed to utils::read.csv()

...

Additional arguments passed to either read_derived_data() (if write_derived_data() was used to create derived dataset) or utils::read.csv()

Examples


# 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)
head(d)
#>   ID  AMT TIME    DV   WT
#> 1  1 4.02 0.00    NA 79.6
#> 2  1   NA 0.00  0.74   NA
#> 3  1   NA 0.25  2.84   NA
#> 4  1   NA 0.57  6.57   NA
#> 5  1   NA 1.12 10.50   NA
#> 6  1   NA 2.02  9.66   NA

## only non-ignored rows
d_nonignore <- input_data(m1, filter = TRUE)