I know of (base? classic?) data.frame
, data.table
, and tibble
.
What other classes satisfy is.data.frame
? (Obviously any can be constructed, so perhaps I want answers limited to those established in a package on CRAN.)
I know of (base? classic?) data.frame
, data.table
, and tibble
.
What other classes satisfy is.data.frame
? (Obviously any can be constructed, so perhaps I want answers limited to those established in a package on CRAN.)
This is an implementation of is.data.frame
:
function (x)
inherits(x, "data.frame")
<bytecode: 0x5586f8758948>
<environment: namespace:base>
As you can see, it will return TRUE
only if your object has a class data.frame
. What data.table
and tibble
do is they extend data.frame
class. Concretely:
x <- data.frame(a = rnorm(10))
class(x)
#> [1] "data.frame"
class(data.table::as.data.table(x))
#> [1] "data.table" "data.frame"
class(tibble::as_tibble(x))
#> [1] "tbl_df" "tbl" "data.frame"
Created on 2018-08-31 by the reprex package (v0.2.0).