
CourseKata Statistics and Data Science is an interactive online textbook for teaching introductory statistics and data science in colleges, universities, and high schools. Part of CourseKata’s Better Book Project, we use research and student data to keep improving online learning resources.
Learn more about CourseKata and its services and materials at CourseKata.org.
The coursekata package makes it easy to install and load the packages, functions, and data used in CourseKata courses and supplementary materials. It additionally provides a handful of helper functions and augments some generic functions to provide cohesion between the network of packages. This package was inspired by the tidyverse meta-package.
You can try coursekata before installing anything: the live demo runs R and the coursekata package entirely in your browser (no installation required, powered by JupyterLite). It opens a getting-started notebook that walks through loading the package, exploring course data sets, and fitting and visualizing models.
install.packages("coursekata")After installing the core packages, you might want to install the supplementary data packages used in the course. These are not required for the package to work, but they are used in the course materials. You can install them with the following command:
coursekata::coursekata_install()If you don’t install these packages, you will be prompted to install
them each time you load the package. If you want to disable that prompt,
you can set options(coursekata.quickstart = TRUE).
To get a bug fix or to use a feature from the development version,
you can install the development version of coursekata from
GitHub.
# install.packages("pak")
pak::pak("coursekata/coursekata-r")library(coursekata) will load the following core
packages in addition to the functions and
theme included in the coursekata package:
library(coursekata)b0(), b1(), PRE(),
fVal())print.lm() which prints the fitted
equation as wellIn addition to useful functions, many data sets are used by instructors who teach the course. This package installs these:
coursekata.quickstart: Each time the package is
loaded (e.g. via library(coursekata)) a check is run to
ensure that all the dependencies are installed and reasonably
up-to-date. If they are not, you will be prompted to install missing
packages. This can be disabled by setting
options(coursekata.quickstart = TRUE).
coursekata.quiet: By default, the package will show
all startup messages from the dependent packages. To quiet these (like
in the output above), you can set
options(coursekata.quiet = TRUE)
This package also comes with a variety of functions useful for
teaching statistics and data science: tools for layering models and
residuals onto plots (e.g. gf_model(),
gf_resid()), extracting estimates from fitted models for
bootstrapping (e.g. b0(), b1(),
pre()), sectioning distributions
(e.g. middle(), tails()), and quantifying
model fit. It also automatically sets a ggplot2 theme
complete with colorblind-friendly palettes and other improvements to aid
perception and clarity of plots.
Browse all of the functions and data sets, organized by what they are for, in the package reference.
If you see an issue, problem, or improvement that you think we should know about, or you think would fit with this package, please let us know on our issues page. Alternatively, if you are up for a little coding of your own, submit a pull request:
git checkout -b my-new-featuregit commit -am 'Add some feature'git push origin my-new-feature