![]() You might consider using it if your table is big. You can achieve the same result using data.table as well. ![]() # Select stats for comparison with other solutions # Create an extended version with a bunch of stats It is worth noting that this answer has been updated to reflect the changed behavior of as_tibble() with regards to how it handles rownames in ames: library(psych) A full example duplicating the previous solutions is included below, combining psych::describe() with some tidyverse stuff to get the exact tibble we are looking for. It doesn't do completely arbitrary functions, but pretty much anything one would realistically want to do. ![]() So in the end I decided on using psych::describe() which is a function designed for exactly this thing. After trying to fix this within the dplyr framework it seemed like it would always be somewhat fragile because it relied on string parsing. But I ran into robustness issues: Because it relies on parsing variable names it choked on columns with underscores in the names. I liked paljenczy's idea of just using dplyr/tidy and getting the table in a ame/tibble before formatting it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |