我有一个非常大的表,有点类似于下面描述的表。
.
├── pom.xml
└── src
└── test
└── jmeter
└── Your_Test.jmx
我正试图转动数据,但是,不能。请建议!
答案 0 :(得分:2)
您的数据集中存在错误。一旦确定每个值对应一个变量组合,就应该好了。
例如,见
> RF1[duplicated(RF1[, 1:3]), ]
FullCloneName Domain FieldName ResultValue
25 1100.Z78346.18G2.F3.G4 VK LightChainObservedMass1 23676
26 1100.Z78346.18G2.F3.G4 VK LightChainObservedMass1 23675
28 1100.Z78346.18G2.F3.G4 VK LightChainObservedMass1 23675
29 1100.Z78346.18G2.F3.G4 VK LightChainRelativeAbundance1 100
30 1100.Z78346.18G2.F3.G4 VK LightChainObservedMass1 23675
31 1100.Z78346.18G2.F3.G4 VK LightChainRelativeAbundance1 100
33 1100.Z78346.18G2.F3.G4 VH HeavyChainObservedMass1 49829
35 1100.Z78346.18G2.F3.G4 VH HeavyChainObservedMass1 49830
36 1100.Z78346.18G2.F3.G4 VH HeavyChainRelativeAbundance1 100
37 1100.Z78346.18G2.F3.G4 VH HeavyChainObservedMass1 49830
38 1100.Z78346.18G2.F3.G4 VH HeavyChainRelativeAbundance1 100
请注意,第25,26,27,30行几乎相同(来自相同的FieldName
和Domain
。第29行和第31行相同,依此类推......
@rawr提出的方法应该有效。
> xy <- data.frame(var1 = rep(LETTERS[1:3], each = 4),
+ var2 = rep(letters[1:6], each = 2),
+ var3 = rep(1:2, times = 6),
+ value = round(rchisq(12, df = 20)))
> xy
var1 var2 var3 value
1 A a 1 17
2 A a 2 22
3 A b 1 9
4 A b 2 21
5 B c 1 21
6 B c 2 10
7 B d 1 9
8 B d 2 29
9 C e 1 24
10 C e 2 20
11 C f 1 16
12 C f 2 18
> dcast(xy, var1 + var2 ~ var3)
var1 var2 1 2
1 A a 17 22
2 A b 9 21
3 B c 21 10
4 B d 9 29
5 C e 24 20
6 C f 16 18