![](/img/trans.png)
[英]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.