Coerce to DataFrame

as.DataFrame(x)

Arguments

x

Object.

Examples

data(dt, sparse, tbl, package = "acidtest") ## data.table to DataFrame ==== x <- as(dt, "DataFrame") head(x)
#> DataFrame with 4 rows and 5 columns #> rn sample1 sample2 sample3 sample4 #> <character> <integer> <integer> <integer> <integer> #> 1 ENSG00000000001 1 5 9 13 #> 2 ENSG00000000002 2 6 10 14 #> 3 ENSG00000000003 3 7 11 15 #> 4 ENSG00000000004 4 8 12 16
## sparseMatrix to DataFrame ==== x <- as(sparse, "DataFrame") ## tbl_df to DataFrame ==== x <- as(tbl, "DataFrame") head(x)
#> DataFrame with 4 rows and 4 columns #> sample1 sample2 sample3 sample4 #> <integer> <integer> <integer> <integer> #> ENSG00000000001 1 5 9 13 #> ENSG00000000002 2 6 10 14 #> ENSG00000000003 3 7 11 15 #> ENSG00000000004 4 8 12 16