某些行的标准变量
我有一个很长的数据集,其中包含不同类型的问题。
age <- ("18-30","31-45","60+","46-60", "31-45", "18-30", "60+", "46-60")
gender <- ("M","F","F","F","M","M","F","M")
case <- ("Q1","Q1","Q2","Q2","Q3","Q3","Q4","Q4")
height <- (0,200,310,0,0,175,270,150)
我想计算高度列的平均值,平均值和标准偏差。因此,Q1,Q2,Q3和Q4的4个不同表。我对R的了解真的有限,有人可以帮助我吗? 提前致谢
I have a long dataset with different type of questions referred to in the case row.
age <- ("18-30","31-45","60+","46-60", "31-45", "18-30", "60+", "46-60")
gender <- ("M","F","F","F","M","M","F","M")
case <- ("Q1","Q1","Q2","Q2","Q3","Q3","Q4","Q4")
height <- (0,200,310,0,0,175,270,150)
I would like to calculate, the mean, the median and standard deviation per question for the height column. So 4 different tables for Q1, Q2, Q3 and Q4. I my knowledge of r is really limited anyone can help me with it please?
thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您需要每种情况的单个数据框,则可以简单地
过滤
就所需的问题,即第一种情况“ Q1”If you want individual dataframes for each case, you can simply
filter
for the questions you want, i.e. for the first case "Q1"