nlmixrdevelopment / nlmixr

nlmixr: an R package for population PKPD modeling
https://nlmixrdevelopment.github.io/nlmixr/
GNU General Public License v2.0
114 stars 45 forks source link

feature request: nlmixr( ..., keep = ... ) should transferred original values #585

Closed dzianismr closed 2 years ago

dzianismr commented 2 years ago

nlmixr has a nice option "keep" to transfer additional columns from the input data to the output, however for instead of preserving values it enumerates the data. Example: theo_sd$SEX <- "MALE" theo_sd$SEX[ theo_sd$ID > 6 ] <- "FEMALE" fit0 <- nlmixr(one.cmt, theo_sd, list(print=0), est="focei") fit1 <- nlmixr(one.cmt, theo_sd, list(print=0), est="focei", keep=c("SEX"))

Fit1 will include additional column "SEX" not required model fitting, however instead of original values it will contain enumerated values. unique( fit1$SEX )

[1] 1 2 It could be more convenient if "keep" transferred original values to the output dataset.