Commit 1fcf46e8 authored by dmattek's avatar dmattek

Fixed: no mean line if NAs present

parent ca0500df
......@@ -313,7 +313,7 @@ modTrajRibbonPlot = function(input, output, session,
if(input$rBPlotTrajStat == "Mean") {
# calculate the mean
loc.dt.aggr = loc.dt[, .(Mean = mean(get(COLY))), by = c(in.facet, COLRT)]
loc.dt.aggr = loc.dt[, .(Mean = mean(get(COLY), na.rm = T)), by = c(in.facet, COLRT)]
} else if(input$rBPlotTrajStat == "CI") {
# calculate the mean and the confidence intervals
......@@ -326,9 +326,10 @@ modTrajRibbonPlot = function(input, output, session,
} else if(input$rBPlotTrajStat == "SE") {
# calculate the mean and the standard error of the mean
loc.dt.aggr = loc.dt[, .(Mean = mean(get(COLY)),
Lower = mean(get(COLY)) - LOCstderr(get(COLY)),
Upper = mean(get(COLY)) + LOCstderr(get(COLY))), by = c(in.facet, COLRT)]
loc.dt.aggr = loc.dt[, .(Mean = mean(get(COLY), na.rm = T),
Lower = mean(get(COLY), na.rm = T) - LOCstderr(get(COLY), na.rm = T),
Upper = mean(get(COLY), na.rm = T) + LOCstderr(get(COLY), na.rm = T)),
by = c(in.facet, COLRT)]
loc.ribbon.lohi = c('Lower', 'Upper')
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment