如何在echarts4r“ e_pie`派中显示计数
我有一个包含4个变量的列,这些变量(坏,好,非常好,出色)
我需要计算它们在该列中重复多少,并在Echarts4r中的饼图和bar图中进行比较,并在饼图和条形图中提示
我:df< - data.frame(var = c(“ low”,“ low”,“ low”,“ low”,“ high”))
我想要的结果与GGPLOT(DF)+GEOM_BAR(AES(var))
。
I have a column that contains 4 variables which are( Bad , Good , Very Good , Excellent )
I need to count how much they repeats in that column and compare each of them and presint to me in pie chart and bar chart in echarts4r
For example : df <- data.frame( var = c("low","low","low","high") )
i want the same result as ggplot(df)+geom_bar(aes(var))
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,您需要创建一个显示每个VAR计数的数据框,然后可以在
e_chart
中使用e_bar
之后使用它:output:output:
是相同的结果。
使用
ggplot
:First you need to create a dataframe which shows the count per var and after that you can use this in
e_chart
withe_bar
like this:Output:
Which is the same result using
ggplot
: