diff --git a/R/covEq.R b/R/covEq.R index 1caa8c8..b7eec84 100644 --- a/R/covEq.R +++ b/R/covEq.R @@ -9,8 +9,9 @@ .monolix2rx$odeType <- "nonStiff" .Call(`_monolix2rx_trans_equation`, text, " [COVARIATE] EQUATION:") .ret <- list(monolix=text, - rx=c(.monolix2rx$equationLine, - .monolix2rx$pk$equation$endLines), + dplyr=gsub("<-", "=", + c(.monolix2rx$equationLine, + .monolix2rx$pk$equation$endLines), fixed=TRUE), odeType=.monolix2rx$odeType) class(.ret) <- "monolix2rxCovEq" .ret diff --git a/R/dataCov.R b/R/dataCov.R index 1139dac..ab3a05d 100644 --- a/R/dataCov.R +++ b/R/dataCov.R @@ -46,6 +46,13 @@ mlxtranGetMutate <- function(mlxtran) { }, character(1), USE.NAMES=FALSE)) } + .cov <- mlxtran$MODEL$COVARIATE$EQUATION + if (!is.null(.cov)) { + .mutate <- c(.mutate, + paste0("dplyr::mutate(", + paste(.cov$dplyr, collapse=",\n\t\t"), + ")")) + } if (length(.mutate) == 0) return(NULL) # Add equations paste(.mutate, collapse=" |> \n\t") diff --git a/R/dataImport.R b/R/dataImport.R index 4d84c3b..410eecf 100644 --- a/R/dataImport.R +++ b/R/dataImport.R @@ -22,7 +22,6 @@ } } } - browser() .mutate <- mlxtranGetMutate(mlxtran) if (!is.null(.mutate)) { .minfo("modifying input data to match monolix transformations")