2016-09-15 55 views
0

我使用plotly创建情节和我试图创建一个箱线图具有下列数据打印箱线图中的R与plotly

data = data.frame(conn_1000 = c(970.09, 384, 1495), conn_2000 = c(970.09, 384, 1495), conn_4000 = c(1042.72, 685, 1495), conn_6000 = c(1012.92, 68, 1482)) 

plot_ly(y = data, type = "box") 

至于结果,我得到一个空的阴谋。你知道错误在哪里吗?

回答

3

您可以尝试melt您的数据和长格式添加groupy

,因为你需要的数据,但现在你有广泛

plotly::plot_ly(data=reshape2::melt(data), type = "box",group = variable,y=value) 

enter image description here