GithubHelp home page GithubHelp logo

m-clark / tidyext Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 2.0 3.28 MB

Extensions and extras for tidy processing.

Home Page: https://m-clark.github.io/tidyext/

License: Other

R 100.00%
r tidyverse datapreprocessing summary-statistics dplyr tidyr group-by summary onehot-encoder sparse-matrix

tidyext's Introduction

R build status codecov


tidyext

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 devtools package is required.

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

Note that this package more or less assumes your are working within the tidyverse, especially dplyr. As such you should have the tidyverse packages installed.

Functions

  • cat_by: A quick summarize for categorical variables, possibly with dplyr::group_by, that provides frequencies and percentages of categories, ready for publishing tables or plotting.

  • combn_2_col: Takes a column with multiple entries per cell and creates indicator columns of all possible combinations of the cell values up to m combinations.

  • create_prediction_data: Straightforward way to quickly create data to make model predictions.

  • describe_all: 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 describe_all_num and describe_all_cat for numeric-only and categorical-only data respectively.

  • num_by: A quick summarize, possibly with dplyr::group_by, that provides things like mean, sd, etc. See num_summary.

  • num_summary: A little better than the base R summary, gives the info one typically wants as well as options for rounding and other statistics.

  • onehot: A function for one-hot encoding with a few helpful options for dealing with missing data, using sparse matrices, and more.

  • pre_process: Easily pre-process a data set with common operations like standardization, logging, etc.

  • sum_NA, sum_NaN, sum_blank: Understand your nothingness.

  • row_sums, row_means, row_apply: Simple (intuitive) rowwise calculations.


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

tidyext's People

Contributors

m-clark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tidyext's Issues

cat_by should handle ordered

Ordered factors will fail early due to having two classes., just take the first class and/or make more flexible the summarise_at part that does an initial check of classes of the variables.

fix key name

Right now, the key name is just 'key', rather than name provided. Something like enquo to !! is needed.

Obviously.

create_prediction_data fails

It's the standard select_not issue in new and improved form. See updated for visibly package via other means.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.