将多个频率数据添加到 R 中的 highchart 条形图中
我遇到了这个网站展示如何使用 highchart 生成交互式条形图。频率称为“len”,我想知道是否有 len1、len2、len3 和 len4,我们如何在 highchart barplot 中包含所有 len1-4?
我正在复制他们在下面提供的 R 代码:
# Load required R packages
library(highcharter)
# Set highcharter options
options(highcharter.theme = hc_theme_smpl(tooltip = list(valueDecimals = 2)))
df <- data.frame(dose=c("D0.5", "D1", "D2"),
len=c(4.2, 10, 29.5))
df2 <- data.frame(supp=rep(c("VC", "OJ"), each=3),
dose=rep(c("D0.5", "D1", "D2"),2),
len=c(6.8, 15, 33, 4.2, 10, 29.5))
hc <- df2 %>%
hchart('column', hcaes(x = 'dose', y = 'len', group = 'supp')) %>%
hc_colors(c("#0073C2FF", "#EFC000FF"))
hc
有人可以提供一些指导吗?我手绘了我的意思的情节。谢谢。
I came across this website which show how to generate an interactive barplot using highchart. The frequency is called 'len' and I would like to know if there are len1, len2, len3 and len4, how do we include all len1–4 in highchart barplot?
I'm copying the R code they provide below:
# Load required R packages
library(highcharter)
# Set highcharter options
options(highcharter.theme = hc_theme_smpl(tooltip = list(valueDecimals = 2)))
df <- data.frame(dose=c("D0.5", "D1", "D2"),
len=c(4.2, 10, 29.5))
df2 <- data.frame(supp=rep(c("VC", "OJ"), each=3),
dose=rep(c("D0.5", "D1", "D2"),2),
len=c(6.8, 15, 33, 4.2, 10, 29.5))
hc <- df2 %>%
hchart('column', hcaes(x = 'dose', y = 'len', group = 'supp')) %>%
hc_colors(c("#0073C2FF", "#EFC000FF"))
hc
Can someone gives some guidance? I hand drawn the plot that I mean. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论