conditionally assign error bar to plot using geom_error bar from GGPLOT.
UPPER ERROR BAR - LOG SCALE
if (df$scl == 'lg' ) {
p <<- p+ geom_errorbar(data=summ,aes(ymin=avg-0, ymax=avg+sd), width=.2,
position=position_dodge(.9))
} # UPPER ERROR BAR - LOG SCALE ENDS
UPPER ERROR BAR - LOG SCALE
if (df$scl == 'lg' ) {
p <<- p+ geom_errorbar(data=summ,aes(ymin=avg-0, ymax=avg+sd), width=.2,
position=position_dodge(.9))
} # UPPER ERROR BAR - LOG SCALE ENDS
Error bar is not assigned even though condition is true.
> dput(head(df, 20))
structure(c("function (x, df1, df2, ncp, log = FALSE) ", "{",
" if (missing(ncp)) ", " .Call(C_df, x, df1, df2, log)",
" else .Call(C_dnf, x, df1, df2, ncp, log)", "}"), .Dim = c(6L,
1L), .Dimnames = list(c("1", "2", "3", "4", "5", "6"), ""), class =
"noquote")