Ich habe einen Datenrahmen von 10 Variablen und habe ihn in zwei Spalten gezeichnet. Aber ggplot
definiert Whisker als 5. und 95. Perzentil. Ich möchte Whiskerlängen wie Q1 - 1.5*IQR/Q3 + 1.5*IQR
für jedes dieser Diagramme und Ausreißer wie üblich. Eine ähnliche Frage wurde in diesem link veröffentlicht, aber ich konnte es nicht verwenden. Jede Hilfe wird geschätzt !!Ändern der Whiskerlänge von mehreren Boxplots in R
library(ggplot2)
library(tidyr)
df <- data.frame(matrix(rnorm(2000), ncol = 10))
plot.data <- gather(df, variable, value)
# plot.data$out <- as.numeric(rep(input_data, each = nrow(x_train)))
p <- ggplot(plot.data, aes(x = 0, y=value))
p <- p + geom_boxplot()
#p <- p + geom_point(aes(x = 0, y = test_data), color = "red")
p <- p + facet_wrap(~variable, scales = "free_x", strip.position = 'top', ncol = 2)
p <- p + coord_flip()
p <- p + xlab("") + ylab("")
p <- p + theme(legend.position="none") + theme_bw()
p <- p + theme(axis.text.y=element_blank(),
axis.ticks.y=element_blank())
p
Die untere Antwort in der Zeit nach Einstellung gefunden Sie scheint einfach: stackoverflow.com/a/38504938/3124909 – CMichael