juanr: Data for Teaching

A collection of datasets I use for teaching. Mostly political science + economics + toy data from other data science courses.

Installation

You can install the development version of {juanr} from Github via the {remotes} package.

remotes::install_github("hail2thief/juanr")

Contents

Here's the data I've got in the package so far:

alldata <- data(package = "juanr")
library(knitr)
library(tibble)
library(dplyr)

object_name <- paste0("`",alldata$results[, "Item"],"`")


getdescript <- function(package){
  db = tools::Rd_db(package)
  db <- tools::Rd_db(package)
  descript <- lapply(db,function(x) {
    tags <- tools:::RdTags(x)
    if("\\description" %in% tags){
      out <- paste(unlist(x[[which(tags=="\\description")]][[2]]),collapse="")
    }
    else
      out <- NULL
    invisible(out)
  })
  gsub("\n","",unlist(descript))
}

descripts <- getdescript("juanr")

tibble(`**Object Name**` = object_name,
       `**Description**` = descripts)  %>%
  arrange(`**Object Name**`) %>%
  knitr::kable(., format="markdown")


hail2thief/ladata documentation built on Sept. 9, 2024, 1:28 p.m.