2.4 Converting between base R data.frame and tidyverse tibble

Some R functions will not work with tibbles. It is easy to convert to a data.frame using as.data.frame().

class(RheumArth_tibble)
## [1] "tbl_df"     "tbl"        "data.frame"
RheumArth <- as.data.frame(RheumArth_tibble)
class(RheumArth)
## [1] "data.frame"

Conversely, if you have a data.frame but want to convert to a tibble, use as_tibble().

class(RheumArth)
## [1] "data.frame"
RheumArth_tibble <- as_tibble(RheumArth)
class(RheumArth_tibble)
## [1] "tbl_df"     "tbl"        "data.frame"