[英]Plot error bars in grouped barplot through barplot() function in R
[英]Grouped barplot using R barplot function
我正在使用以下代码使用 R barplot function 获取分组条形图。
> df <- read.csv2(text = "x;y;z
A;40;11
B;66;16
C;27;13
D;10;42")
> bp <- barplot(t(df[ , -1]), beside=T, names=df$x)
但是当我的数据有小数时,这不起作用。 如果我的数据如下,就像我无法获得条形图:
> df <- read.csv2(text = "x;y;z
A;40.9;11
B;66;16
C;27;13
D;10;42")
有没有办法修改此代码以获取十进制值的图? 我想使用 R barplot function,而不是进入一些 R ZEFE90A8E604A7C870E
谢谢
在 df 中使用逗号而不是点:
> df <- read.csv2(text = "x;y;z
A;40,9;11
B;66;16
C;27;13
D;10;42")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.