|
|
@@ -115,7 +115,6 @@ add.p.values.fisher<-function(df,dfRef,var,timeVar='visitid',nVar='total'){
|
|
|
#' Plot comparison of measured and reference fractions
|
|
|
#'
|
|
|
#' @param df data frame of measured fractions
|
|
|
-#' @param dfRef data frame of reference fractions
|
|
|
#' @param var target fraction variable
|
|
|
#' @param timeVar variable measuring time
|
|
|
#' @param doseVar variable for selecting datasets
|
|
|
@@ -123,8 +122,6 @@ add.p.values.fisher<-function(df,dfRef,var,timeVar='visitid',nVar='total'){
|
|
|
#' @param doseBreaks values to break plots to
|
|
|
#' @param doseLabels labels for legend for breaks
|
|
|
#' @param doseColors colors to use for different plots
|
|
|
-#' @param timeBreaks where time points are assigned
|
|
|
-#' @param timeLabels labels for time points
|
|
|
#'
|
|
|
#' @return grob object with ggplot
|
|
|
#'
|
|
|
@@ -132,18 +129,17 @@ add.p.values.fisher<-function(df,dfRef,var,timeVar='visitid',nVar='total'){
|
|
|
#'
|
|
|
#' @importFrom rlang .data
|
|
|
#'
|
|
|
-get.ggplot<-function(df,dfRef,var,timeVar='visitid',doseVar='dose',nVar='total',
|
|
|
- doseBreaks=base::c(60,62,100),doseLabels=base::c('60 Gy','62 Gy','all'),doseColors=base::c('red','magenta','blue'),
|
|
|
- timeBreaks=base::c(0,1,3,4),timeLabels=base::c('beforeRT','at20','at3mo','at12mo')){
|
|
|
+get.ggplot<-function(df,var,timeVar='visitid',doseVar='dose',nVar='total',
|
|
|
+ doseBreaks=base::c(59.9,60,62,100),doseLabels=base::c('ref','60 Gy','62 Gy','all'),doseColors=base::c('grey70','red','magenta','blue')){
|
|
|
df<-add.conf.int(df,var,nVar)
|
|
|
- dfRef<-add.conf.int(dfRef,var,nVar)
|
|
|
+ #dfRef<-add.conf.int(dfRef,var,nVar)
|
|
|
|
|
|
ghigh<-base::sprintf("%s_high",var)
|
|
|
glow<-base::sprintf("%s_low",var)
|
|
|
ggplot2::ggplot()+
|
|
|
- ggplot2::geom_ribbon(ggplot2::aes(x=.data[[timeVar]],ymin=.data[[glow]],ymax=.data[[ghigh]]),dfRef,fill='grey70')+
|
|
|
+ #ggplot2::geom_ribbon(ggplot2::aes(x=.data[[timeVar]],ymin=.data[[glow]],ymax=.data[[ghigh]],dfRef,fill='grey70')+
|
|
|
ggplot2::geom_ribbon(ggplot2::aes(x=.data[[timeVar]],ymin=.data[[glow]],ymax=.data[[ghigh]],fill=base::as.factor(.data[[doseVar]])),df,alpha=0.2)+
|
|
|
- ggplot2::geom_line(ggplot2::aes(x=.data[[timeVar]],y=.data[[var]]),dfRef)+
|
|
|
+ #ggplot2::geom_line(ggplot2::aes(x=.data[[timeVar]],y=.data[[var]]),dfRef)+
|
|
|
ggplot2::geom_line(ggplot2::aes(x=.data[[timeVar]],y=.data[[var]],color=base::as.factor(.data[[doseVar]])),df)+
|
|
|
ggplot2::scale_color_manual(name = "Dose", breaks = doseBreaks, values = doseColors,labels=doseLabels)+
|
|
|
ggplot2::scale_fill_manual(name = "Dose", breaks = doseBreaks, values = doseColors,labels=doseLabels)+
|