有一个数据集,我想创建一个带有异常值的箱线图highcharter
。箱线图有效,但我似乎无法将异常值放在正确的x-axis
位置;由于某种原因,它们都被分组在位置 0 上。箱线图是正确的,所以我不确定为什么异常值不遵循箱线图。
下面是我的代码:
library (highcharter)
Quote <- c(12,15,16,12,14,19,13,12,17,15,14,18,22,25,29,30,14,2,5,4)
Other <- c(30,35,36,12,18,35,39,41,42,43,45,31,37,35,32,31,34,36,32,15)
Shop <- c(2,1,5,4,6,9,5,4,7,8,1,5,4,3,5,4,1,5,15,19)
PN <- c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)
Dat <- data.frame(Quote,Other,Shop, PN)
highchart() %>%
hc_add_series_boxplot(Dat$Quote, Dat$PN, name = "Quote Hold Time", color = "#FF8888", pointStart = 0) %>%
hc_add_series_boxplot(Dat$Other, Dat$PN, name = "Other Hold Time", color = "#E5A919", pointStart = 1) %>%
hc_add_series_boxplot(Dat$Shop, Dat$PN, name = "Shop Time", color = "#51C1BC", pointStart = 2) %>%
hc_xAxis(categories = c("Quote Hold","Other Hold","Shop Time"), labels = list(enabled = TRUE)) %>%
hc_yAxis(labels = list(format = "{value} days"), min = 0) %>%
hc_plotOptions(series = list(grouping = FALSE))
下面是问题的图片。所有这些scatter (outliers)
都位于 x 轴上的 Quote Hold 类别下。