Difference between revisions of "Data.table"
From kogic.kr
(Created page with "<p>YalPak_Rtip</p> <h1>Convert a molten data table into an data table (array type)</h1> <h3>Input</h3> <p> &nbs...") |
|||
Line 1: | Line 1: | ||
− | <p>[[YalPak_Rtip]]</p> | + | <p><span style="font-family:courier new,courier,monospace">[[YalPak_Rtip]]</span></p> |
− | <h1>Convert a molten data table into an data table (array type)</h1> | + | <h1><span style="font-family:courier new,courier,monospace">Convert a molten data table into an data table (array type)</span></h1> |
− | <h3>Input</h3> | + | <h3><span style="font-family:courier new,courier,monospace">Input</span></h3> |
− | < | + | <div style="background:#eee;border:1px solid #ccc;padding:5px 10px;"><span style="font-family:courier new,courier,monospace"> Species ID Var1 Var2 Val Group Print_name<br /> |
1: Dendronephthya_gigantea g30906.t1.cds@g30906@000029F CDS_length Full 2.01600e+03 Non-symbiotic_cnidarian Carnation_coral<br /> | 1: Dendronephthya_gigantea g30906.t1.cds@g30906@000029F CDS_length Full 2.01600e+03 Non-symbiotic_cnidarian Carnation_coral<br /> | ||
2: Dendronephthya_gigantea g14782.t1.cds@g14782@000108F CDS_length Full 4.02000e+02 Non-symbiotic_cnidarian Carnation_coral<br /> | 2: Dendronephthya_gigantea g14782.t1.cds@g14782@000108F CDS_length Full 4.02000e+02 Non-symbiotic_cnidarian Carnation_coral<br /> | ||
3: Dendronephthya_gigantea g9986.t1.cds@g9986@000064F CDS_length Full 8.40000e+02 Non-symbiotic_cnidarian Carnation_coral<br /> | 3: Dendronephthya_gigantea g9986.t1.cds@g9986@000064F CDS_length Full 8.40000e+02 Non-symbiotic_cnidarian Carnation_coral<br /> | ||
4: Dendronephthya_gigantea g1279.t1.cds@g1279@000024F CDS_length Full 8.58000e+02 Non-symbiotic_cnidarian Carnation_coral<br /> | 4: Dendronephthya_gigantea g1279.t1.cds@g1279@000024F CDS_length Full 8.58000e+02 Non-symbiotic_cnidarian Carnation_coral<br /> | ||
− | 5: Dendronephthya_gigantea g9325.t1.cds@g9325@000042F CDS_length Full 8.61000e+02 Non-symbiotic_cnidarian Carnation_coral</ | + | 5: Dendronephthya_gigantea g9325.t1.cds@g9325@000042F CDS_length Full 8.61000e+02 Non-symbiotic_cnidarian Carnation_coral</span></div> |
− | <h3>Code</h3> | + | <h3><span style="font-family:courier new,courier,monospace">Code</span></h3> |
− | < | + | <div style="background:#eee;border:1px solid #ccc;padding:5px 10px;"><span style="font-family:courier new,courier,monospace"><big>dcast(dt, ID ~ Var1, value.var = "Val")</big></span></div> |
− | <h3>Output</h3> | + | <h3><span style="font-family:courier new,courier,monospace">Output</span></h3> |
− | < | + | <div style="background:#eee;border:1px solid #ccc;padding:5px 10px;"><span style="font-family:courier new,courier,monospace"> ID CDS_length FPKM<br /> |
1: g10.t1.cds@g10@000002F 1185 30.363500<br /> | 1: g10.t1.cds@g10@000002F 1185 30.363500<br /> | ||
2: g100.t1.cds@g100@000002F 696 0.959006<br /> | 2: g100.t1.cds@g100@000002F 696 0.959006<br /> | ||
3: g1000.t1.cds@g1000@000011F 660 0.000000<br /> | 3: g1000.t1.cds@g1000@000011F 660 0.000000<br /> | ||
4: g10000.t1.cds@g10000@000064F 1074 0.278465<br /> | 4: g10000.t1.cds@g10000@000064F 1074 0.278465<br /> | ||
− | 5: g10001.t1.cds@g10001@000064F 522 0.962268 </ | + | 5: g10001.t1.cds@g10001@000064F 522 0.962268 </span></div> |
Revision as of 13:08, 27 November 2018
Contents
Convert a molten data table into an data table (array type)
Input
Species ID Var1 Var2 Val Group Print_name
1: Dendronephthya_gigantea g30906.t1.cds@g30906@000029F CDS_length Full 2.01600e+03 Non-symbiotic_cnidarian Carnation_coral
2: Dendronephthya_gigantea g14782.t1.cds@g14782@000108F CDS_length Full 4.02000e+02 Non-symbiotic_cnidarian Carnation_coral
3: Dendronephthya_gigantea g9986.t1.cds@g9986@000064F CDS_length Full 8.40000e+02 Non-symbiotic_cnidarian Carnation_coral
4: Dendronephthya_gigantea g1279.t1.cds@g1279@000024F CDS_length Full 8.58000e+02 Non-symbiotic_cnidarian Carnation_coral
Code
dcast(dt, ID ~ Var1, value.var = "Val")
Output
ID CDS_length FPKM
1: g10.t1.cds@g10@000002F 1185 30.363500
2: g100.t1.cds@g100@000002F 696 0.959006
3: g1000.t1.cds@g1000@000011F 660 0.000000
4: g10000.t1.cds@g10000@000064F 1074 0.278465