Skip to content

Commit f00ca5e

Browse files
Make sex_discrimination version (#52)
1 parent fdc9ae4 commit f00ca5e

File tree

6 files changed

+73
-0
lines changed

6 files changed

+73
-0
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* `lizard_run` and `lizard_habitat` (thanks Stephen Adolph!)
55
* `daycare_fines`, `biontech_adolescents`, `nyc_marathon`, `epa2021`
66
* Add tests for some of the new datasets
7+
* Better terminology: `sex_discrimination`
78

89
# openintro 2.1.0
910

R/data-sex_discrimination.R

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#' Bank manager recommendations based on sex
2+
#'
3+
#' Study from the 1970s about whether sex influences hiring recommendations.
4+
#'
5+
#' @name sex_discrimination
6+
#' @docType data
7+
#' @format A data frame with 48 observations on the following 2 variables.
8+
#' \describe{
9+
#' \item{sex}{a factor with levels \code{female} and \code{male}}
10+
#' \item{decision}{a factor with levels \code{not promoted} and \code{promoted}}
11+
#' }
12+
#' @source Rosen B and Jerdee T. 1974. Influence of sex role stereotypes on
13+
#' personnel decisions. Journal of Applied Psychology 59(1):9-14.
14+
#' @keywords datasets
15+
#' @examples
16+
#'
17+
#' library(ggplot2)
18+
#'
19+
#' table(sex_discrimination)
20+
#'
21+
#' ggplot(sex_discrimination, aes(y = sex, fill = decision)) +
22+
#' geom_bar(position = "fill")
23+
#'
24+
"sex_discrimination"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Load previous version of openintro package containing previous version
2+
# of evals data frame. I took the last commit on 2021-05-18:
3+
# remotes::install_github("https://github.com/OpenIntroStat/openintro@fdc9ae408d53d9f2efe4c62c85a956a49346e64d", force = TRUE)
4+
library(openintro)
5+
library(tidyverse)
6+
library(usethis)
7+
8+
# Make categorical variables factor
9+
sex_discrimination <- openintro::gender_discrimination %>%
10+
rename(sex = gender)
11+
12+
# Add to package
13+
use_data(sex_discrimination, overwrite = TRUE)

data/sex_discrimination.rda

250 Bytes
Binary file not shown.

man/sex_discrimination.Rd

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkgdown/_pkgdown.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ reference:
194194
- satgpa
195195
- scotus_healthcare
196196
- seattlepets
197+
- sex_discrimination
197198
- sinusitis
198199
- sleep_deprivation
199200
- smallpox

0 commit comments

Comments
 (0)