Nothing
## LOAD PACKAGES HERE library(NMproject) library(dplyr) library(ggplot2) ## DO NOT MODIFY THE REST OF THIS BLOCK (unless you know what you're doing) library(knitr) library(rprojroot) opts_knit$set(root.dir = find_root( has_file(".Rprofile") | is_rstudio_project | is_r_package | is_git_root )) opts_chunk$set(echo = FALSE) opts_chunk$set(message = FALSE) if(!is.null(knitr::opts_knit$get('rmarkdown.pandoc.to'))){ .m <- params$m }
Any knitr parameters will be displayed here:
print(params)
wait_finish(.m)
library(vpc) ## prep an obs and a sim for vpc function obs <- parent_run(.m) %>% output_table_first() %>% filter(INNONMEM) ## manipulate these to get TPERIOD obs <- obs %>% group_by(ID) %>% mutate(DPERIOD = cumsum(!is.na(AMT))) %>% group_by(ID, DPERIOD) %>% mutate(TPERIOD = TIME - min(TIME)) %>% ungroup() obs <- obs[!is.na(obs$DV), ] sim <- .m %>% output_table_first() %>% filter(INNONMEM) sim <- sim[!is.na(sim$DV), ] sim$DPERIOD <- rep(obs$DPERIOD, length = nrow(sim)) sim$TPERIOD <- rep(obs$TPERIOD, length = nrow(sim)) sim$DV <- sim$DV_OUT ## needed because output_table puts DV in DV_OUT
vpc::vpc( sim = sim, obs = obs, obs_cols = list(idv = "TPERIOD"), sim_cols = list(idv = "TPERIOD") )
vpc::vpc( sim = sim, obs = obs, obs_cols = list(idv = "TPERIOD"), sim_cols = list(idv = "TPERIOD"), pred_corr = TRUE )
sim$WT_c = Hmisc::cut2(sim$WT, g = 2) obs$WT_c = Hmisc::cut2(obs$WT, g = 2) vpc::vpc( sim = sim, obs = obs, obs_cols = list(idv = "TPERIOD"), sim_cols = list(idv = "TPERIOD"), stratify = "WT_c" )
.m %>% text() %>% dplyr::first()
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.