PKPDsim
PKPDsim copied to clipboard
Beginning Test Run
Hello Im trying PKPDSim and ran the below code as in the site: install.packages("PKPDsim") library(PKPDsim) library(ggplot2)
pk2 <- new_ode_model( code = "dAdt[1] = -(CL/V) * A[1]", obs = list(cmt = 1, scale = "V"), dose = list(cmt = 1) ) r2 <- new_regimen( amt = 100, n = 5, interval = 12, type = "infusion", t_inf = 2 ) dat2 <- sim( ode = pk2, parameters = p, regimen = r2, only_obs = TRUE ) ggplot(dat2, aes(x = t, y = y)) + geom_line()
Can you help advice what is not right here please Thank you Jesmin