I have the following long table:
> long.table
Source: local data frame [846,996 x 3]
index case amp
(int) (chr) (dbl)
1 1 TCGA-AR-A1AH 1
2 2 TCGA-AN-A0G0 1
3 2 TCGA-AR-A1AH 1
4 3 TCGA-AR-A1AH 1
5 4 TCGA-E9-A1R7 1
6 5 TCGA-AN-A0FL 1
7 6 TCGA-A7-A26G 1
8 6 TCGA-AN-A0FL 1
9 7 TCGA-A7-A26G 1
10 7 TCGA-AN-A0FL 1
.. ... ... ...
from which I created short.table by slicing off the first five rows:
> tbl.test.2
Source: local data frame [5 x 3]
index case amp
(int) (chr) (dbl)
1 1 TCGA-AR-A1AH 1
2 2 TCGA-AN-A0G0 1
3 2 TCGA-AR-A1AH 1
4 3 TCGA-AR-A1AH 1
5 4 TCGA-E9-A1R7 1
If I use dcast(table, case ~ index)
for each of the tables, I get different behavior: In the long case, I get integer-valued columns for the index values and the missing combinations are filled in with zeros. However, in the short case, I get numeric-valued columns for the index values and the missing combinations are filled in with NAs.
Question: Does default behavior change for very long tables?