Explorar el Código

Correcting .data to be called wihtin a mask context

Andrej hace 1 semana
padre
commit
f1c7dd9657
Se han modificado 1 ficheros con 4 adiciones y 5 borrados
  1. 4 5
      R/hypoAfrica.R

+ 4 - 5
R/hypoAfrica.R

@@ -139,12 +139,11 @@ get.ggplot<-function(df,dfRef,var,timeVar='visitid',doseVar='dose',
 
    ghigh<-base::sprintf("%s_high",var)
    glow<-base::sprintf("%s_low",var)
-   xV<-.data[[timeVar]]
    ggplot2::ggplot()+
-	ggplot2::geom_ribbon(ggplot2::aes(x=xV,ymin=.data[[glow]],ymax=.data[[ghigh]]),dfRef,fill='grey70')+
-	ggplot2::geom_ribbon(ggplot2::aes(x=xV,ymin=.data[[glow]],ymax=.data[[ghigh]],fill=base::as.factor(.data[[doseVar]])),df,alpha=0.2)+
-	ggplot2::geom_line(ggplot2::aes(x=xV,y=.data[[var]]),dfRef)+
-	ggplot2::geom_line(ggplot2::aes(x=xV,y=.data[[var]],color=base::as.factor(.data[[doseVar]])),df)+
+	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]],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)+
 	ggplot2::theme(legend.position="bottom")+