Browse Source

Adding nVar variable to get.ggplot

Andrej 1 week ago
parent
commit
189bc597e3
1 changed files with 3 additions and 2 deletions
  1. 3 2
      R/hypoAfrica.R

+ 3 - 2
R/hypoAfrica.R

@@ -119,6 +119,7 @@ add.p.values.fisher<-function(df,dfRef,var,timeVar='visitid',nVar='total'){
 #' @param var target fraction variable
 #' @param timeVar variable measuring time
 #' @param doseVar variable for selecting datasets
+#' @param countVar variable where counts are stored
 #' @param doseBreaks values to break plots to
 #' @param doseLabels labels for legend for breaks
 #' @param doseColors colors to use for different plots
@@ -131,11 +132,11 @@ 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',
+get.ggplot<-function(df,dfRef,var,timeVar='visitid',doseVar='dose',nVar='ntotal',
    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')){
    df<-add.conf.int(df,var)
-   dfRef<-add.conf.int(dfRef,var)
+   dfRef<-add.conf.int(dfRef,var,nVar)
 
    ghigh<-base::sprintf("%s_high",var)
    glow<-base::sprintf("%s_low",var)