knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
klippy::klippy(position = c("top", "right"))

Introduction

This package contains tools to create demo datasets for instructional use (e.g., in undergraduate statistics classes).

Installation

Source package

Users can download and install the source package by calling the install.packages() function from the utils R package, which comes pre-installed with R.

utils::install.packages(
  pkgs = "https://github.com/barnzilla/r-package-sources/raw/master/glebe.datasets_0.6.tar.gz",
  repos = NULL, 
  type = "source"
)
library(glebe.datasets)

GitHub

The most recent version of the glebe.datasets R package is also available on GitHub: www.github.com/barnzilla/glebe.datasets. The devtools R package allows users to download and install the glebe.datasets R package directly from GitHub.

devtools::install_github("barnzilla/glebe.datasets", upgrade = "never", build_vignettes = TRUE, force = TRUE)
library(glebe.datasets)
library(glebe.datasets)

Once the glebe.datasets R package is loaded, any available tutorials for the package, such as this vignette, can be accessed by calling the browseVignettes() function.

browseVignettes("glebe.datasets")

Getting started

Create a demo dataset

Users can createa a demo dataset by calling the get_dataset() function. This function takes one argument, n, which represents the number of participants (rows) that will be in the dataset.

demo_dataset <- get_dataset(n = 500)

Examine the structure of the dataset

The structure of the dataset can be examined by calling the str() function that comes pre-installed with R.

str(demo_dataset)

Export the dataset

Users can export a demo dataset to either Excel or SPSS using the export_dataset() function.

export_dataset(
  demo_dataset, 
  path = "c:/users/joel/desktop/demo_dataset.xlsx", 
  type = "spss"
)

export_dataset(
  demo_dataset, 
  path = "c:/users/joel/desktop/demo_dataset.spss", 
  type = "spss"
)


barnzilla/glebe.datasets documentation built on Oct. 29, 2020, 1:54 a.m.