knitr::opts_chunk$set(
  collapse = T,
  comment = "#>",
  fig.path = "man/README-",
  out.width = "100%"
)

# still working on sidebar information, the solutions are evasive at present. 

Data for Preceptor's Primer for
Bayesian Data Science

About this package

PPBDS.data provides the data and the tutorials used in Preceptor's Primer for Bayesian Data Science, the textbook used in Gov 50: Data at Harvard University.

Installation

As this package is not released on CRAN, you must install it directly from GitHub.

remotes::install_github("davidkane9/PPBDS.data")

Loading Preceptor's Data

After installing the package, it loads as any package should.

library(tidyverse) 
library(PPBDS.data)

qscores

Using the data

Once the library is loaded and you have confirmed that it can be accessed in your local environment, the data sets can be called as objects and used like any other data you would otherwise read in and assign to an object manually. See the following example of a plot using PPBDS.data::qscores.

library(ggplot2)

qscores %>% 
  filter(department == "GOV") %>% 
  ggplot(aes(hours, rating, color = term)) +
    geom_point(aes(size = enrollment), alpha = 0.4) +
    geom_smooth(method = "lm", formula = y ~ x, se = FALSE) +
    facet_wrap(~term) +
    labs(
      title = "Student Course Evaluations at Harvard",
      subtitle = "Department of Government",
      caption = "Data provided by Aurash Vatan '23",
      x = "Weekly workload, hours",
      y = "Rating, 1 (worst) to 5 (best)",
      size = "Enrollment") +
    theme_linedraw() +
    theme(
        text = element_text(family = "Palatino"),
        axis.text.x = element_text(size = 10),
        axis.text.y = element_text(size = 10)) +
    scale_color_discrete(guide = "none")

Citing PPBDS.data

citation("PPBDS.data")
# DK: Add some comments to explain what is going on here. What does build_home()
# do and why is build_site() commented out?

# pkgdown::build_site()

pkgdown::build_home()


davidkane9/PPBDS.data documentation built on Nov. 18, 2020, 1:17 p.m.