Description Usage Arguments Details Value S3 as_tibble() S4 as() Note See Also Examples
Coerce to tbl_df
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## S3 method for class 'DataFrame'
as_tibble(
x,
...,
rownames = pkgconfig::get_config("tibble::rownames", "rowname")
)
## S3 method for class 'IPosRanges'
as_tibble(
x,
...,
rownames = pkgconfig::get_config("tibble::rownames", "rowname")
)
## S3 method for class 'GenomicRanges'
as_tibble(
x,
...,
rownames = pkgconfig::get_config("tibble::rownames", "rowname")
)
|
x |
A data frame, list, matrix, or other object that could reasonably be coerced to a tibble. |
... |
Other arguments passed on to individual methods. |
rownames |
How to treat existing row names of a data frame or matrix:
|
Our defined methods attempt to improve on the defaults in the tibble package
to ensure that row names are not dropped by default, which is a poor default
for bioinformatics. This is accomplished by setting rownames = "rowname"
by
default instead of rownames = NULL
.
tbl_df
.
as_tibble()
transformer extends as_tibble()
method support for
these S4 classes:
DataFrame
.
GRanges
.
as()
Since tbl_df
is a virtual class that extends tbl
and data.frame
, we
need to define an S4 coercion method that allows us to use
as()
to coerce an object to a tibble.
See getClass("tbl_df")
for details on how tibble is a virtual class.
Updated 2020-01-08.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | data(DataFrame, GRanges, IRanges, package = "acidtest")
## DataFrame to tbl_df ====
x <- as(DataFrame, "tbl_df")
x <- as_tibble(DataFrame)
print(x)
## GenomicRanges to tbl_df ====
x <- as(GRanges, "tbl_df")
x <- as_tibble(GRanges)
print(x)
## IRanges to tbl_df ====
x <- as(IRanges, "tbl_df")
x <- as_tibble(IRanges)
print(x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.