Skip to content

tibble's reference documentation should be updated to explictedly state how to deal with matrices #978

@mccroweyclinton-EPA

Description

@mccroweyclinton-EPA
library(magrittr)
library(tibble)
cat("Tibble's reference documentation states that it works similarly to
     base::data.frame() but it actually has different behaviour for matrices")
cat ("\n\nCan tibble::tibble() take matries as inputs? Yes it can but the
      resulting tibble is much different than what is expected, here are the
      dimensions of installed.packages() when converted to a tibble using
     tibble()\n")
installed.packages() %>% tibble() %>% dim() %>% cat()

cat("\n\nNotice how the number of dimensions is different than when calling
     base::data.frame()
     \n")
installed.packages() %>% data.frame() %>% dim() %>% cat()

cat("\n\nI think that the correct way to convert maticies to a tibble is by
     using the as_tibble() function but the tibble reference documentation
     (?tibble::tibble) does not mention this. If tibble() behaves differently
     for matrices than base::data.frame() then the tibble reference doc should
     explictedly say so and it should direct users to use as_tibble() instead.
     \n")
installed.packages() %>% as_tibble() %>% dim() %>% cat()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions