Learn R Programming

Overview

A package that includes functions that I find useful for teaching statistics as well as actually practicing the art. They typically are not “new” methods but rather wrappers around either base R or tidyverse packages. Currently contains the following major user oriented functions:

  • Plot2WayANOVA which as the name implies conducts a 2 way ANOVA and plots the results using ggplot2
  • PlotXTabs2 which wraps around ggplot2 to provide Bivariate bar charts for categorical and ordinal data.
  • newggslopegraph which creates a Tufte“esque” slopegraph using ggplot2
  • chaid_table provides tabular summary of CHAID partykit object
  • cross2_var_vectors a helper function to build lists of “crossed” variables
  • SeeDist which wraps around ggplot2 to provide visualizations of univariate data.
  • OurConf is a simulation function that helps you learn about confidence intervals

Installation

# Install from CRAN
install.packages("CGPfunctions")

# Or the development version from GitHub
# install.packages("devtools")
devtools::install_github("ibecav/CGPfunctions", 
                         build_vignettes = TRUE,
                         upgrade = "ask")

Usage

Online documentation and vignettes are located here.

Example Plot2WayANOVA plot

Example Plot2WayANOVA

Example PlotXTabs2 plot

Example PlotXTabs2 plot

Example newggslopegraph plot

Example newggslopegraph plot

Credits

Many thanks to Danielle Navarro and the book Learning Statistics with R.

Leaving Feedback

If you like CGPfunctions, please consider leaving feedback here.

Contributing

Contributions in the form of feedback, comments, code, and bug reports are most welcome. How to contribute:

  • Issues, bug reports, and wish lists: File a GitHub issue.
  • Contact the maintainer ibecav at gmail.com by email.

Copy Link

Version

Install

install.packages('CGPfunctions')

Monthly Downloads

1,165

Version

0.6.3

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Chuck Powell

Last Published

November 12th, 2020

Functions in CGPfunctions (0.6.3)

CGPfunctions

CGPfunctions: A package of miscellaneous functions for teaching statistics.
SeeDist

SeeDist -- See The Distribution
aovtype2

Anova Tables for Type 2 sums of squares
PlotXTabs

Plot a Cross Tabulation of two variables using dplyr and ggplot2
PlotXTabs2

Bivariate bar (column) charts with statistical tests
Mode

Derive the modal value(s) for a set of data
Plot2WayANOVA

Plot a 2 Way ANOVA using dplyr and ggplot2
BrownForsytheTest

Brown-Forsythe Test for Homogeneity of Variance using median
OurConf

Plotting random samples of confidence intervals around the mean
chaid_table

Produce CHAID results tables from a partykit CHAID model
cross2_var_vectors

Cross two vectors of variable names from a dataframe
USvoteS

U.S. 2000 Election Data (short)
exponent

Exponent of a number in scientific notation
newgdp

Tufte dataset on Gross Domestic Product, 1970 and 1979
bf_display

Choose display type for BF formatting.
number_to_word

Convert a vector of numbers to large-number word representation
chaidUS

U.S. 2000 Election Data (short)
newggslopegraph

Plot a Slopegraph a la Tufte using dplyr and ggplot2
newcancer

Tufte dataset on cancer survival rates
justifyme

Justification for titles, subtitles and captions.
newbroom

Tidy Tables for htest objects