![]() ![]() I do find myself constantly misspelling “tabyl” as “taybl” though, which is annoying, but not really something I can really criticise anyone else for. But it’s a great improvement over base table. The only thing missing really is a cumulative percentage option. It the output is tidy, and works with kable just fine. ![]() It can optionally sort in order of frequency. This is a pretty good start! By default, it shows counts, percents, and percent of non-missing data. I would recommend looking at any of the janitor, summarytools and questionr package functions outlined below if you have similar requirements and tastes to me. In no particular order:īecause I am fussy, I managed to find some slight personal niggle with all of them, so it’s hard to pick an overall personal winner for all circumstances. So what’s available outside of base R? I tested 5 options, although there are, of course, countless more. ![]() prop.table(table(data$Type))īut you’d need to run both commands to understand the count and percentages, and the latter inherits many of the limitations from the former. The table command can be wrapped in the prop.table command to show proportions. The output also isn’t tidy and doesn’t work well with Knitr. ![]() It does have a useNA parameter that will show that though if desired. By default it hasn’t highlighted that there are some records with missing data. But it doesn’t show percentages or any sort of cumulation. table(data$Type)Ī super simple way to count up the number of records by type. Most famously, perhaps the “table” command. So what options come by default with base R?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |