Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors installing caffsim #1

Open
nholford opened this issue Sep 28, 2017 · 7 comments
Open

Errors installing caffsim #1

nholford opened this issue Sep 28, 2017 · 7 comments

Comments

@nholford
Copy link

Spelling error https://github.com/asancpt/caffsim
install.pacakges("devtools")
Ran the command with correct spelling
Then tried:
devtools::install_github("asancpt/caffsim")
This failed as follows.
Any suggestions on how to complete the installation?

  • package 'caffsim' ...
    ** R
    ** data
    *** moving datasets to lazyload DB
    ** inst
    ** preparing package for lazy loading
    Error : object 'f_eval' is not exported by 'namespace:lazyeval'
    ERROR: lazy loading failed for package 'caffsim'
  • removing 'C:/Docs/R/win-library/3.4/caffsim'
    Installation failed: Command failed (1)
@shanmdphd shanmdphd added the bug label Sep 29, 2017
@shanmdphd
Copy link
Member

Hi, Dr. Holford. Thanks for reporting a bug. Let me figure out what went wrong.

Sungpil

@shanmdphd shanmdphd self-assigned this Sep 29, 2017
@shanmdphd
Copy link
Member

shanmdphd commented Sep 29, 2017

This is possibly related to the issue of ggplot2. You can probably try this.

install.packages("lazyeval")
install.packages("forcats")

Please let me know if this helps.

Sungpil

@nholford
Copy link
Author

nholford commented Sep 29, 2017 via email

@shanmdphd
Copy link
Member

shanmdphd commented Sep 29, 2017

Thanks for reporting an error again. This is quite preliminary yet and to me, it's the first pharmacometrics R package I've ever made so there must be a lot of bugs and unexpected things. So your feedback is invaluable.

  1. I'll try to solve the caffShiny() issue. Instead, you can try the web app first.
  2. I had little idea about medical use of caffeine in neonates. This is a new perspective I can work on. Probably your paper will be a good point to start with.

I've not expected that somebody will submit issues regarding this R package through GitHub
and especially I've never expected that the issuer is you. :-)

Best regards,
Sungpil

@nholford
Copy link
Author

nholford commented Sep 29, 2017 via email

@shanmdphd
Copy link
Member

Nick,

Thanks for sharing your follow-up story.

A caffPkparam() function in the file R/caffPkparam.R contains how we calculate the clearance according to this paper.

caffPkparam <- function(Weight, Dose, N = 20){
  mgcv::rmvn(N, CaffMu, CaffSigma) %>% 
    as_tibble() %>% 
    select(eta1 = 1, eta2 = 2, eta3 = 3) %>% 
    mutate(CL = 0.09792 * Weight * exp(eta1), # L/hr
           V  = 0.7219 * Weight * exp(eta2), 
           # TVV =THETA[2] * (1 + ABST*THETA[7]) [1] 0.7218775
           Ka = 4.268 * exp(eta3), # /hr
           Ke = CL / V,
           Tmax = (log(Ka) - log(Ke)) / (Ka - Ke),
           Cmax = Dose / V * Ka / (Ka - Ke) * (exp(-Ke * Tmax) - exp(-Ka * Tmax)), 
           AUC  = Dose / CL, # mg/h/L
           Half_life = 0.693 / Ke) %>% 
    mutate(subjid = row_number()) %>% 
    select(subjid, Tmax, Cmax, AUC, Half_life, CL, V, Ka, Ke)
}

An information regarding CaffMu and CaffSigma is in data-raw/use_data.R.

CaffSigma <- matrix(c(0.1599, 6.095e-2, 9.650e-2, 
                      6.095e-2, 4.746e-2, 1.359e-2, 
                      9.650e-2, 1.359e-2, 1.004), nrow = 3)
CaffMu <- c(0,0,0)

Hope this helps and it would be definitely interesting (and meaningful) if the similar approach can be applied to the caffeine PK in neonates.

Regards,
Sungpil

@nholford
Copy link
Author

nholford commented Sep 29, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants