SkillAgentSearch skills...

Tidyext

Extensions and extras for tidy processing.

Install / Use

/learn @m-clark/Tidyext

README

R build
status codecov <a href="https://github.com/m-clark/tidyext" alt="Miscellaneous Shenanigans"> <img src="https://img.shields.io/badge/miscellaneous_shenanigans-constant-ff5500.svg?colorA=00aaff&longCache=true&style=for-the-badge" style="width:50%"/></a>

<br>

tidyext <img src="man/figures/tidyext_hex.png" align = "right" width = 100>

Overview

Extensions and extras for tidy processing. This package provides some data processing and summarizing functions that would commonly be useful in the tidyverse. For folks that do a lot of data processing in that world, these make a handful of some very common tasks a bit easier, and with an eye toward eventual tidy/clean presentation and visualization with tools like kableExtra and ggplot2.

As these functions are more universally useful, especially to my colleagues and friends who use R, putting them as their own package with few dependencies will perhaps make it easier to use for them. The goal is more or less for this to depend on nothing one wouldn’t have already with base R and the tidyverse package loaded. Also, as all the functions use the tidyverse functionality, they are easily customizable.

Installation

To install from GitHub the <span class="pack">devtools</span> package is required.

devtools::install_github('m-clark/tidyext')

Note that this package more or less assumes your are working within the <span class="pack">tidyverse</span>, especially <span class="pack">dplyr</span>. As such you should have the <span class="pack">tidyverse</span> packages installed.

Functions

  • <span class="func">cat_by</span>: A quick summarize for categorical variables, possibly with dplyr::group_by, that provides frequencies and percentages of categories, ready for publishing tables or plotting.

  • <span class="func">combn_2_col</span>: Takes a column with multiple entries per cell and creates indicator columns of all possible combinations of the cell values up to m combinations.

  • <span class="func">create_prediction_data</span>: Straightforward way to quickly create data to make model predictions.

  • <span class="func">describe_all</span>: A summary function for mixed data types that provides the information I usually want. Saves one from doing a group_by %>% summarize operation to create multiple results for multiple types of variables. Has corresponding <span class="func">describe_all_num</span> and <span class="func">describe_all_cat</span> for numeric-only and categorical-only data respectively.

  • <span class="func">num_by</span>: A quick summarize, possibly with dplyr::group_by, that provides things like mean, sd, etc. See <span class="func">num_summary</span>.

  • <span class="func">num_summary</span>: A little better than the base R summary, gives the info one typically wants as well as options for rounding and other statistics.

  • <span class="func">onehot</span>: A function for one-hot encoding with a few helpful options for dealing with missing data, using sparse matrices, and more.

  • <span class="func">pre_process</span>: Easily pre-process a data set with common operations like standardization, logging, etc.

  • <span class="func">sum_NA</span>, <span class="func">sum_NaN</span>, <span class="func">sum_blank</span>: Understand your nothingness.

  • <span class="func">row_sums</span>, <span class="func">row_means</span>, <span class="func">row_apply</span>: Simple (intuitive) rowwise calculations.

<br>

Version history

  • 0.3.0 add row_sums, row_means, row_apply
  • 0.2.x Misc updates
  • 0.2.0 Website
  • 0.1.3 Added gather_multi
  • 0.1.2 Added spread2
  • 0.1.1 Added pre_process
  • 0.1.0 Initial release
View on GitHub
GitHub Stars6
CategoryDevelopment
Updated2y ago
Forks2

Languages

R

Security Score

60/100

Audited on Oct 9, 2023

No findings