简体   繁体   English

如何在 rbokeh 中创建嵌套/分组类别的箱线图?

[英]How to create a Box-plot of nested/grouped categories in rbokeh?

I need to create a nested category box-plot where the x-axis is a combination of 2 factor(category) groups.我需要创建一个嵌套类别箱线图,其中 x 轴是 2 个因子(类别)组的组合。 In ly_boxplot() , the x argument can either be a numeric vector or a factor .ly_boxplot()x参数可以是数字向量因子 Is there a way that it will accept a combined factor, say, of 2 or more factors?有没有办法接受两个或更多因素的组合因素?

The picture below is taken from this link .下面的图片来自 这个链接

How can I create such a plot using rbokeh library in R?如何使用 R 中的rbokeh库创建这样的图?

在 x 轴嵌套类别箱线图上具有分组类别的箱线图

Use the interaction function.使用interaction功能。

library(rbokeh)
figure(ylab = "Length (mm?)", xlab="Dose (mg/day) : Supplement") %>%
  ly_boxplot(len, interaction(dose,supp), data = ToothGrowth)

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM