adpc_a <- adpc %>%filter( PARAM =="Plasma Drug X", ARMCD =="ARM A" ) %>%mutate(Patient_ID =sub(".*id-", "", USUBJID))use_title <-"Plot of Plasma Drug X (ug/mL) Concentrations Over Time by\nPatient: PK Evaluable Patients"use_subtitle <-"Analyte: Plasma Drug X (ug/mL) \nTreatment Group: ARM A"use_footnote <-"Program: \nOutput:"result <-g_ipp(df = adpc_a,xvar ="NFRLT",yvar ="AVAL",xlab ="Norminal Time from First Dose (hr)",ylab ="Concentration (ug/mL)",id_var ="Patient_ID",add_baseline_hline =FALSE,yvar_baseline ="AVAL", # yvar_baseline cannot be NA or ignoretitle = use_title,subtitle = use_subtitle,caption = use_footnote,plotting_choices ="separate_by_obs")plot <- result[[1]] # only show the first subjectplot
Experimental use!
WebR is a tool allowing you to run R code in the web browser. Modify the code below and click run to see the results. Alternatively, copy the code and click here to open WebR in a new tab.
adpc_a <- adpc %>%filter( PARAM =="Plasma Drug X", ARMCD =="ARM A" ) %>%mutate(avalog =ifelse(AVAL !=0, AVAL, 0.001)) %>%mutate(Patient_ID =sub(".*id-", "", USUBJID))use_title2 <-"Plot of Plasma Drug X (ug/mL) Concentrations Over Time by\nPatient: PK Evaluable Patients"use_subtitle2 <-"Analyte: Plasma Drug X (ug/mL) \nTreatment Group: ARM A"use_footnote2 <-"Program: \nOutput:"result <-g_ipp(df = adpc_a,xvar ="NFRLT",yvar ="avalog",xlab ="Norminal Time from First Dose (hr)",ylab ="Concentration (ug/mL)",id_var ="Patient_ID",add_baseline_hline =FALSE,yvar_baseline ="AVAL", # yvar_baseline cannot be NA or ignoretitle = use_title2,subtitle = use_subtitle2,caption = use_footnote2,plotting_choices ="separate_by_obs")plot <- result[[1]] + ggplot2::scale_y_log10(breaks =c(0.001, 0.01, 0.1, 1, 10), labels =c(0.001, 0.01, 0.1, 1, 10))plot
Experimental use!
WebR is a tool allowing you to run R code in the web browser. Modify the code below and click run to see the results. Alternatively, copy the code and click here to open WebR in a new tab.