Coder Social home page Coder Social logo

ian-curtis / gvsu215 Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 2.0 15.78 MB

Pretty output for select {mosaic} and {ggformula} functions. Designed for the GVSU Introductory Statistics course (STA 215).

Home Page: https://gvsu215.ianacurtis.com

License: Other

R 100.00%
ggformula mosaic r statistics

gvsu215's Introduction

gvsu215

Pretty Plots and Charts for Introductory Statistical Concepts

CRAN status Lifecycle: stable Netlify Status

Note: Due to the fact that some functions return tables (which are essentially HTML code), the README on GitHub does not display properly. As a result, the output is an image of the resulting table rather than the actual HTML table. These images will not include the table caption at this time.

gvsu215 contains a series of wrapper functions around select {mosaic} and {ggformula} functions, with help from {flextable} and {ggplot2}. The goal is to provide introductory statistics students/learners with an easy way to generate nice-looking plots and tables without focusing on the code used to create them. All tables and plots generated from this package have been doctored and have had themes pre-applied. As such, output will not print in “messy” format to the R console and can be used interactively, including in R Markdown documents.

This package was designed and tailored for Grand Valley State University (course code: STA 215) but can be used by anyone.

Installation

This package is not on CRAN. You can install the development version of gvsu215 from GitHub with:

# install.packages("devtools")
devtools::install_github("ian-curtis/gvsu215")

Prerequisites

In order to use this package, you will need a basic understanding of R syntax and how to run a function in your preferred working environment. Functions use formula syntax (e.g., var1 ~ var2) and thus knowledge of formulas is needed as well.

Examples

This package is best used for creating simple plots and charts where extensive customization is not necessary. For instance, you may just want to see summary statistics, including one- or two-way tables.

library(gvsu215)
tbl_2var(mtcars, gear~cyl)

tbl_num_sum(mtcars, ~wt, na_rm = TRUE)

Or maybe you just need percentiles:

tbl_pctile(mtcars, ~wt, probs = c(0, .25, .4, .5, .6, .75, 1))

There is also support for a variety of plots…

plot_bar(mtcars, ~cyl, type = "percent")

plot_box(mtcars, 
         wt~gear, 
         fill = 'orangered4', 
         x = "Gear", 
         y = "Weight", 
         title = "Boxplot of Weight by Gear")

plot_scatter(mtcars, wt~drat)
#> NAs always removed (in pairs) for scatterplots.

… and statistical inference.

infer_1prop(mtcars, ~vs, success = 1)

infer_paired(mtcars, var1 = ~drat, var2 = ~wt)

infer_2mean_int(mtcars, wt~vs)

suppressWarnings(infer_chisq(mtcars, cyl~gear))

suppressWarnings(infer_chisq(mtcars, cyl~gear, type = "expected"))

infer_anova(mtcars, cyl~gear, digits = 2)

Help, Bug Reports, and Feature Requests

Errors happen! If you come across an error you don’t think you should have, feel free to create an issue on GitHub. If you’d like to suggest a change or addition, you can use the issues page for that, too!

gvsu215's People

Contributors

ian-curtis avatar

Watchers

 avatar

gvsu215's Issues

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.