ich habe ein seltsames Problem mit geom_ribbon. Wenn ich mit unten stehendem Code Werte mit Konfidenzintervallen plotte, werden diese sehr seltsam ausgehenen. Leider finde ich auch nach intensiver Suche im Netz keine Lösung und bin etwas ratlos. Alldieweil das Konfidenzintervall in bestimmten Abschnitten korrekt ausgegeben wird. Hat irgend jemand von Euch eine >Idee wo mein Fehler liegt? Herzlichen Dank.
Code: Alles auswählen
if (!"plotly" %in% installed.packages()) install.packages("plotly")
require("plotly")
if (!"htmltools" %in% installed.packages()) install.packages("htmltools")
require("htmltools")
if (!"htmlwidgets" %in% installed.packages()) install.packages("htmlwidgets")
require(htmlwidgets)
if (!"lubridate" %in% installed.packages()) install.packages("lubridate")
require(lubridate)
all_data_tmp <- read.delim("~/Plausability and quality control/Helgoland_MarGate_Underwaterobservatory_2019_Hydrography_short[attachment=0]Helgoland_MarGate_Underwaterobservatory_2019_Hydrography_short.csv")
all_data_tmp$date <- ymd_hms(as.character(all_data_tmp$date))
all_data_tmp <- as.data.frame(all_data_tmp[(order(as.Date(all_data_tmp$date))),])
plot_title <- paste0(Sys.time(),": Sensor kernel density values (blue) and 90% confidence limits (grey) - see metadata description")
j <- ggplot(all_data_tmp, aes(date,all_data_tmp[,6])) +
geom_point(size = 0.2, color="blue") +
labs(title = plot_title, x='date', y='chlorophyll a [mg m3]') +
geom_ribbon(aes(ymin=all_data_tmp[,6]-all_data_tmp[,7], ymax=all_data_tmp[,6]+all_data_tmp[,7]), alpha = 0.6, fill="red")
p3 <- ggplotly(j,dynamicTicks = TRUE) %>%
layout(xaxis = list(rangeslider = list()))
print(p3)