由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Mathematics版 - data grouping, sub-grouping by column variable in R (转载)
相关主题
请教proc transpose 问题 (转载)数学问题求教,类似 portfolio optimization. (转载)
Predict values of vectors generated by black box functionsprobability problem
问一个不等式a question about entropy
data clustering by vector correlation distance (转载)how to express this probability in matri
two vectors' coefficient of determination (转载)A math-statistics problem
请教一个向量几何问题不等式一题
怎样解这个特殊的pde[合集] 问一个挺难的数学问题,看看有没有人会啊?
请教网络流的线性规划用什么算较方便probability
相关话题的讨论汇总
话题: var1话题: var2话题: grouping话题: 498455话题: 357835
进入Mathematics版参与讨论
1 (共1页)
l******9
发帖数: 579
1
【 以下文字转载自 Statistics 讨论区 】
发信人: light009 (light009), 信区: Statistics
标 题: data grouping, sub-grouping by column variable in R
发信站: BBS 未名空间站 (Wed Feb 26 13:25:43 2014, 美东)
I am working on data collection by R on Win7.
The given data is:
var1 var2 value
I need to do grouping by var1 and then for each var1 , do grouping by var2.
Then, the output is column vectors of values that are associated with the
same var1 and var2. Here, var1 and var2 are like keys.
Example,
var1 var2 value
1 56 649578
2 17 357835
1 88 572397
2 90 357289
1 56 427352
2 17 498455
1 88 354623
2 90 678658
The result should be
var1 var2 value
1 56 649578
1 56 427352
1 88 354623
1 88 572397
2 17 357835
2 17 498455
2 90 357289
2 90 678658
And, I need to print the values in a csv file as
For var 1 as 1:
649578 354623
427352 572397
For var 1 as 2:
357835 357289
498455 678658
And, I also need to print the values in a csv file as
For var 1 = 1:
1 56 649578
1 56 427352
1 88 354623
1 88 572397
For var1 = 2:
2 17 357835
2 17 498455
2 90 357289
2 90 678658
How to do it ?
I found some posts, which are not directly useful.
Any help would be appreciated.
1 (共1页)
进入Mathematics版参与讨论
相关主题
probabilitytwo vectors' coefficient of determination (转载)
来道概率题请教一个向量几何问题
大虾赐教,关于产生随机数的问题怎样解这个特殊的pde
value of a, b, c, d?请教网络流的线性规划用什么算较方便
请教proc transpose 问题 (转载)数学问题求教,类似 portfolio optimization. (转载)
Predict values of vectors generated by black box functionsprobability problem
问一个不等式a question about entropy
data clustering by vector correlation distance (转载)how to express this probability in matri
相关话题的讨论汇总
话题: var1话题: var2话题: grouping话题: 498455话题: 357835