Просмотр исходного кода

Adding dogde to roc.R to avoid overlapping ROC curves

Andrej 5 дней назад
Родитель
Сommit
5e588f25a3
2 измененных файлов с 4 добавлено и 13 удалено
  1. 1 1
      R/roc.R
  2. 3 12
      man/get.ggplot.Rd

+ 1 - 1
R/roc.R

@@ -273,7 +273,7 @@ simple.plotROCgg<-function(df,vars,cols,x=0.7,y=0.3,unit="ml",precise="FALSE",ta
          lab <- base::sprintf("[%s] AUC: %.2f (+- %.2f), OPT THR: %.2f",
                            var, auc, sAUC, roc_metrics$threshold)
 
-         g<-g+ggplot2::geom_line(ggplot2::aes(x=!!roc$FPR,y=!!roc$TPR,color=!!lab))
+         g<-g+ggplot2::geom_line(ggplot2::aes(x=!!roc$FPR,y=!!roc$TPR,color=!!lab),position=position_dogde(width=0.2))
          aes_p=ggplot2::aes(x=!!roc_metrics$FPR,y=!!roc_metrics$TPR,color=!!lab)
          g<-g+ggplot2::geom_point(aes_p,size=4,shape=1,show.legend=FALSE)
          colors_used<-base::c(colors_used,col)

+ 3 - 12
man/get.ggplot.Rd

@@ -6,23 +6,18 @@
 \usage{
 get.ggplot(
   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")
+  doseBreaks = base::c(59.9, 60, 62, 100),
+  doseLabels = base::c("ref", "60 Gy", "62 Gy", "all"),
+  doseColors = base::c("black", "red", "magenta", "blue")
 )
 }
 \arguments{
 \item{df}{data frame of measured fractions}
 
-\item{dfRef}{data frame of reference fractions}
-
 \item{var}{target fraction variable}
 
 \item{timeVar}{variable measuring time}
@@ -36,10 +31,6 @@ get.ggplot(
 \item{doseLabels}{labels for legend for breaks}
 
 \item{doseColors}{colors to use for different plots}
-
-\item{timeBreaks}{where time points are assigned}
-
-\item{timeLabels}{labels for time points}
 }
 \value{
 grob object with ggplot