R 中数据集的分组和平均值
我想计算不同三次重复的平均值,但似乎找不到一个好方法来做到这一点。我尝试过对数据集进行分组和总结,但仍然没有成功。我使用以下代码来修剪我的数据集:
Data_mini <-
Trimmed_Data %>%
group_by(Component.Name, Sample.Name) %>%
summarise(Area.Ratio)
summarise(DF_ABCR, mymean = mean(Area.Ratio))
我有一个带有组件名称、样本名称和面积比的虚拟数据集。我需要计算每个组件名称的 A1_ABCR1、B1_ABCR1 和 C1_ABCR1(样本名称)的平均值。请参阅图像以获取数据集的直观概述。谁能分享他们对如何最好地解决这个问题的看法?预先感谢您:) 虚拟数据集视觉概述
I want to calculate the mean of different triplicates, but can't seem to figure out a good way to do that. I've tried grouping and summarising my dataset, but still no luck. I've used the following code to trim my dataset :
Data_mini <-
Trimmed_Data %>%
group_by(Component.Name, Sample.Name) %>%
summarise(Area.Ratio)
summarise(DF_ABCR, mymean = mean(Area.Ratio))
I have a dummy dataset with component name, sample name and area ratio. I need to calculate the mean for A1_ABCR1, B1_ABCR1 and C1_ABCR1 (sample name) for each component name. See image for a visual overview of the dataset. Can anyone share their view on how to best tackle this problem? Thank you in advance :) Dummy dataset visual overview
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我创建了一个示例数据:
示例数据:
您可以使用此代码来计算单位面积比率的平均值:
输出:
I created a sample data:
Sample data:
You can use this code to calculate the mean per area ratio:
Output: