Skip to content

Commit

Permalink
Merge branch 'release/0.10.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
adamblake committed Aug 2, 2023
2 parents 7b5aae9 + 07740b1 commit c04a14b
Show file tree
Hide file tree
Showing 13 changed files with 61 additions and 47 deletions.
4 changes: 2 additions & 2 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
^coursekata\.Rproj$
^\.Rproj\.user$
^LICENSE\.md$
^README\.Rmd$
^README\.(?:Rmd|html)$
^\.github$
^codecov\.yml$
^data-raw$
^\.vscode$
^.lintr$
^CHANGELOG\.md$
^CHANGELOG\.md$
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.Rproj.user
.Rhistory
.RData
.DS_Store
.DS_Store
README.html
11 changes: 6 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: coursekata
Title: Packages and Functions for CourseKata Courses
Version: 0.9.4
Date: 2023-07-03
Version: 0.10.0
Date: 2023-08-02
Authors@R: c(
person("Adam", "Blake", , "[email protected]", role = c("cre", "aut"),
comment = c(ORCID = "0000-0001-7881-8652")),
Expand All @@ -17,9 +17,9 @@ Description: Easily install and load all packages and functions used in
License: AGPL (>= 3)
URL: https://www.github.com/UCLTALL/coursekata-r
BugReports: https://www.github.com/UCLTALL/coursekata-r/issues
Depends:
Depends:
R (>= 3.6)
Imports:
Imports:
cli (>= 3.2.0),
crayon (>= 1.5.0),
dslabs (>= 0.7.4),
Expand All @@ -30,6 +30,7 @@ Imports:
Lock5withR (>= 1.2.2),
lsr (>= 0.5.2),
magrittr (>= 2.0.2),
Metrics,
mosaic (>= 1.8.3),
pak,
purrr (>= 0.3.4),
Expand All @@ -38,7 +39,7 @@ Imports:
supernova (>= 2.5.1),
vctrs (>= 0.4.1),
yesno (>= 0.1.2)
Suggests:
Suggests:
fivethirtyeight (>= 0.6.2),
lubridate (>= 1.8.0),
mockery (>= 0.4.3),
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export(theme_coursekata)
export(upper)
import(rlang)
importFrom(Lock5withR,locket)
importFrom(Metrics,sse)
importFrom(dslabs,take_poll)
importFrom(glue,glue)
importFrom(lifecycle,deprecated)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# `coursekata` change log

## coursekata 0.10.0

- Add [`Metrics` package](https://cran.r-project.org/web/packages/Metrics/index.html)

## coursekata 0.9.4

- Double digit `fevdata$AGE` values were truncated by first character. This has been fixed.
Expand Down
1 change: 1 addition & 0 deletions R/coursekata-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ NULL
#' @importFrom lsr cohensD
#' @importFrom mosaic qdist
#' @importFrom supernova supernova
#' @importFrom Metrics sse
NULL
2 changes: 1 addition & 1 deletion R/coursekata_packages.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
coursekata_pkg_list <- c(
"supernova", "mosaic", "lsr",
"supernova", "mosaic", "lsr", "Metrics",
"fivethirtyeight", "fivethirtyeightdata", "Lock5withR", "dslabs"
)

Expand Down
22 changes: 12 additions & 10 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ knitr::opts_chunk$set(

<!-- badges: start -->
<!-- [![CRAN status](https://www.r-pkg.org/badges/version/coursekata)](https://CRAN.R-project.org/package=coursekata) -->
[![R build status](https://github.com/UCLATALL/coursekata-r/workflows/R-CMD-check/badge.svg)](https://github.com/UCLATALL/coursekata-r/actions)
[![codecov](https://codecov.io/gh/uclatall/coursekata-r/branch/main/graph/badge.svg?token=HEenoYyHcn)](https://app.codecov.io/gh/uclatall/coursekata-r)
[![R build status](https://github.com/coursekata/coursekata-r/workflows/R-CMD-check/badge.svg)](https://github.com/coursekata/coursekata-r/actions)
[![codecov](https://codecov.io/gh/coursekata/coursekata-r/branch/main/graph/badge.svg?token=HEenoYyHcn)](https://app.codecov.io/gh/coursekata/coursekata-r)
<!-- badges: end -->


Expand All @@ -28,36 +28,38 @@ knitr::opts_chunk$set(

Learn more about CourseKata and its free services and materials at [CourseKata.org](https://coursekata.org/).

This package makes it easy to install and load all packages and functions used in CourseKata courses. 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](https://tidyverse.tidyverse.org) meta-package.
This package makes it easy to install and load all packages and functions used in CourseKata courses. 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](https://tidyverse.tidyverse.org) meta-package.


## Installation

```{r eval = FALSE}
# Install the development version from GitHub
# install.packages("remotes")
remotes::install_github("UCLATALL/coursekata-r")
remotes::install_github("coursekata/coursekata-r")
```

Note that installing the package will install all of the functions that are used in the course, but by default a couple of packages will not be installed: `fivethirtyeight` and `fivethirtyeightdata`. These packages only contain data, so the R package building process complains when functions are not imported from them. The first time you call `library(coursekata)` you will be prompted to install the packages if they are not already installed.


## Loading Packages Used in CourseKata Courses

`library(coursekata)` will load these core packages in addition to the [functions and theme](#functions-and-theme) included in the `coursekata` package:
`library(coursekata)` will load these core packages in addition to the [functions and theme](#functions-and-theme) included in the `coursekata` package:

```{r}
library(coursekata)
```

* [supernova](https://github.com/UCLATALL/supernova), for
* [supernova](https://github.com/UCLATALL/supernova), for
- creating ANOVA tables.
- tools for extracting information from fitted models (`b0()`, `b1()`, `PRE()`, `fVal()`)
- an augmented `print.lm()` which prints the fitted equation as well
- … and more!
* [mosaic](https://projectmosaic.github.io/mosaic/), for a unified interface to most statistical tools.
* [ggformula](https://projectmosaic.github.io/ggformula/), for a formula interface to ggplot2.
* [dplyr](https://dplyr.tidyverse.org), for data manipulation.
* [Metrics](https://cran.r-project.org/web/packages/Metrics/index.html), for model
evaluation.

In addition to useful functions, a great deal of data sets are used by instructors who teach the course. This package installs these:

Expand All @@ -68,7 +70,7 @@ In addition to useful functions, a great deal of data sets are used by instructo

## Functions and Theme

This package also comes with a variety of functions useful for teaching statistics and data science, and it has an automatically set `ggplot2` theme complete with colorblind-friendly palettes and other improvements to aid perception and clarity of plots.
This package also comes with a variety of functions useful for teaching statistics and data science, and it has an automatically set `ggplot2` theme complete with colorblind-friendly palettes and other improvements to aid perception and clarity of plots.

### Estimate Extraction (and Bootstrapping)

Expand Down Expand Up @@ -121,7 +123,7 @@ samp_dist_of_hp <- do(1000) * {
gf_histogram(~ samp_dist_of_hp$result)
```

### Sectioning a Distribution
### Sectioning a Distribution

When teaching about hypothesis testing, *F*, and *p*-value, it is useful to mark different portions of a distribution as inside or outside the critical zone. `middle()`, `upper()`, and `lower()` each take a distribution of values and return whether the value was in, e.g. the middle 95% of the distribution. Use this with a plotting function to shade in those areas:

Expand All @@ -136,10 +138,10 @@ The `ggplot2` theme is loaded by default but can be toggled on and off via `load

# Contributing

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](https://github.com/UCLATALL/supernova/issues). Alternatively, if you are up for a little coding of your own, submit a pull request:
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](https://github.com/coursekata/coursekata-r/issues). Alternatively, if you are up for a little coding of your own, submit a pull request:

1. Fork it!
2. Create your feature branch: ```git checkout -b my-new-feature```
3. Commit your changes: ```git commit -am 'Add some feature'```
4. Push to the branch: ```git push origin my-new-feature```
5. Submit a [pull request](https://github.com/UCLATALL/supernova/pulls) :D
5. Submit a [pull request](https://github.com/coursekata/coursekata-r/pulls) :D
58 changes: 31 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->

# coursekata <img src='man/figures/logo.png' align="right" height="138.5" />
Expand All @@ -6,17 +7,16 @@
<!-- [![CRAN status](https://www.r-pkg.org/badges/version/coursekata)](https://CRAN.R-project.org/package=coursekata) -->

[![R build
status](https://github.com/UCLATALL/coursekata-r/workflows/R-CMD-check/badge.svg)](https://github.com/UCLATALL/coursekata-r/actions)
[![codecov](https://codecov.io/gh/uclatall/coursekata-r/branch/main/graph/badge.svg?token=HEenoYyHcn)](https://app.codecov.io/gh/uclatall/coursekata-r)

status](https://github.com/coursekata/coursekata-r/workflows/R-CMD-check/badge.svg)](https://github.com/coursekata/coursekata-r/actions)
[![codecov](https://codecov.io/gh/coursekata/coursekata-r/branch/main/graph/badge.svg?token=HEenoYyHcn)](https://app.codecov.io/gh/coursekata/coursekata-r)
<!-- badges: end -->

## Overview

_CourseKata Statistics and Data Science_, is an innovative interactive
*CourseKata Statistics and Data Science*, is an innovative interactive
online textbook for teaching introductory statistics and data science in
colleges, universities, and high schools. Part of CourseKata’s _Better
Book_ Project, we are leveraging research and student data to guide
colleges, universities, and high schools. Part of CourseKata’s *Better
Book* Project, we are leveraging research and student data to guide
continuous improvement of online learning resources. The **coursekata**
package is designed to make it easy to install and load the packages,
functions, and data used in the book and supplementary materials.
Expand All @@ -32,10 +32,10 @@ the [tidyverse](https://tidyverse.tidyverse.org) meta-package.

## Installation

```r
``` r
# Install the development version from GitHub
# install.packages("remotes")
remotes::install_github("UCLATALL/coursekata-r")
remotes::install_github("coursekata/coursekata-r")
```

Note that installing the package will install all of the functions that
Expand All @@ -52,27 +52,31 @@ they are not already installed.
[functions and theme](#functions-and-theme) included in the `coursekata`
package:

```r
``` r
library(coursekata)
#> ── CourseKata packages ───────────────────────────────────── coursekata 0.3.3 ──
#> ✔ supernova 2.5.1 ✔ fivethirtyeightdata 0.1.0
#> ✔ mosaic 1.8.3 ✔ Lock5withR 1.2.2
#> ✔ lsr 0.5.2 ✔ dslabs 0.7.4
#> Registered S3 method overwritten by 'mosaic':
#> method from
#> fortify.SpatialPolygonsDataFrame ggplot2
#> ── CourseKata packages ───────────────────────────────────── coursekata 0.9.4 ──
#> ✔ supernova 2.5.6 ✔ fivethirtyeightdata 0.1.0
#> ✔ mosaic 1.8.4.2 ✔ Lock5withR 1.2.2
#> ✔ lsr 0.5.2 ✔ dslabs 0.7.6
#> ✔ fivethirtyeight 0.6.2
```

- [supernova](https://github.com/UCLATALL/supernova), for
- creating ANOVA tables.
- tools for extracting information from fitted models (`b0()`,
`b1()`, `PRE()`, `fVal()`)
- an augmented `print.lm()` which prints the fitted equation as
well
- tools for extracting information from fitted models (`b0()`, `b1()`,
`PRE()`, `fVal()`)
- an augmented `print.lm()` which prints the fitted equation as well
- … and more!
- [mosaic](https://projectmosaic.github.io/mosaic/), for a unified
interface to most statistical tools.
- [ggformula](https://projectmosaic.github.io/ggformula/), for a
formula interface to ggplot2.
- [ggformula](https://projectmosaic.github.io/ggformula/), for a formula
interface to ggplot2.
- [dplyr](https://dplyr.tidyverse.org), for data manipulation.
- [Metrics](https://cran.r-project.org/web/packages/Metrics/index.html),
for model evaluation.

In addition to useful functions, a great deal of data sets are used by
instructors who teach the course. This package installs these:
Expand All @@ -94,7 +98,7 @@ to aid perception and clarity of plots.
Extracting an estimate is as easy as passing a fitted linear model to
one of the extraction functions:

```r
``` r
fit <- lm(mpg ~ hp, data = mtcars)

# the estimate for β₀, the intercept
Expand Down Expand Up @@ -126,7 +130,7 @@ The estimate extraction functions help to simplify the ability to create
bootstrapped sampling distributions of those estimates. Here is an
example of bootstrapping the slope:

```r
``` r
# use mosaic package to repetitively resample to bootstrap a distribution
samp_dist_of_b1 <- do(1000) * b1(lm(mpg ~ hp, data = resample(mtcars)))

Expand All @@ -140,7 +144,7 @@ Other estimates and terms can be bootstrapped using the same technique,
but you will need to calculate the values yourself. Here’s an example of
doing that for a term that doesn’t have a dedicated extraction function:

```r
``` r
samp_dist_of_hp <- do(1000) * {
# create a new model from the resampled data
model <- lm(mpg ~ disp * hp, data = resample(mtcars))
Expand All @@ -157,14 +161,14 @@ gf_histogram(~ samp_dist_of_hp$result)

### Sectioning a Distribution

When teaching about hypothesis testing, _F_, and _p_-value, it is useful
When teaching about hypothesis testing, *F*, and *p*-value, it is useful
to mark different portions of a distribution as inside or outside the
critical zone. `middle()`, `upper()`, and `lower()` each take a
distribution of values and return whether the value was in, e.g. the
middle 95% of the distribution. Use this with a plotting function to
shade in those areas:

```r
``` r
# shade in the middle 80% of the Thumb distribution
gf_histogram(~Thumb, data = Fingers, fill = ~ middle(Thumb, .80))
```
Expand All @@ -183,13 +187,13 @@ users as `theme_coursekata()` and `scale_discrete_coursekata()`

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](https://github.com/UCLATALL/supernova/issues).
on our [issues page](https://github.com/coursekata/coursekata-r/issues).
Alternatively, if you are up for a little coding of your own, submit a
pull request:

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a [pull request](https://github.com/UCLATALL/supernova/pulls)
:D
5. Submit a [pull
request](https://github.com/coursekata/coursekata-r/pulls) :D
Binary file modified man/figures/README-samp_dist_of_b1-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-samp_dist_of_hp-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-shaded_middle-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/test-coursekata_packages.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pkgs <- c(
"supernova", "mosaic", "lsr",
"supernova", "mosaic", "lsr", "Metrics",
"fivethirtyeight", "fivethirtyeightdata", "Lock5withR", "dslabs"
)

Expand Down

0 comments on commit c04a14b

Please sign in to comment.