gpt4 book ai didi

r - 从矩阵创建条形图

转载 作者:行者123 更新时间:2023-12-01 11:34:05 24 4
gpt4 key购买 nike

所以,我有一个这样的矩阵:

> dput(tbl_sum_peaks[1:40])
structure(c(2, 8, 3, 4, 1, 2, 1, 3, 1, 3, 1, 4, 4, 2, 1, 1, 2,
1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 2, 1, 5, 4, 2, 1, 1, 2, 1,
4, 2), .Names = c("AT1G01050", "AT1G01080", "AT1G01090", "AT1G01320",
"AT1G01470", "AT1G01800", "AT1G01910", "AT1G01960", "AT1G01980",
"AT1G02150", "AT1G02470", "AT1G02500", "AT1G02560", "AT1G02780",
"AT1G02816", "AT1G02880", "AT1G02920", "AT1G02930", "AT1G03030",
"AT1G03090", "AT1G03110", "AT1G03210", "AT1G03220", "AT1G03230",
"AT1G03330", "AT1G03475", "AT1G03630", "AT1G03680", "AT1G03740",
"AT1G03870", "AT1G04080", "AT1G04170", "AT1G04270", "AT1G04410",
"AT1G04420", "AT1G04530", "AT1G04640", "AT1G04650", "AT1G04690",
"AT1G04750"))

我想制作一个将在 yaxis 上显示的条形图具有特定编号的行数。正如我们所看到的,给定的示例数据的大部分行都有一个数字 1,因此数字 1 的条形图将是最高的。

这是一个基本但我无法打开我的大脑......所以有人的帮助将得到返回!

最佳答案

尝试

barplot(table(tbl_sum_peaks))

关于r - 从矩阵创建条形图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29298737/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com