Skip to contents

The flashcard() function generates a set of flashcards with randomly ordered pairs of terms and descriptions from built-in flashcard decks. The function outputs reveal.js presentation as an HTML file. If running in RStudio, the flashcards are output to the viewer. Otherwise, they are output to a web browser.

Usage

flashcard(
  x,
  termsfirst = TRUE,
  package = TRUE,
  theme = "moon",
  file = NULL,
  fontsize = "default",
  fontcolor = NULL,
  linkcolor = NULL,
  use_browser = FALSE
)

Arguments

x

Name of pre-existing flashcard deck or path and name of CSV file containing terms and descriptions

termsfirst

Logical indicating whether to show terms first (TRUE) or descriptions first (FALSE)

package

Logical indicating whether to include package name in term

theme

Name of reveal.js theme to use for flashcards

file

Path and file name used to save flashcard deck locally (must save as HTML)

fontsize

Base font size for presentation. Acceptable values include "default" (500%), "large" (700%), and "small" (300%). Custom values can be set as percentages (e.g., "250%").

fontcolor

Font color for non-link text. Can be R color name, HTML color name, or hex code.

linkcolor

Font color for link text. Can be R color name, HTML color name, or hex code.

use_browser

Logical indicating whether to show the presentation in the RStudio viewer when available (FALSE) or the system's default browser (TRUE)

Value

An HTML file of terms and descriptions rendered in the RStudio viewer or web browser.

See also

Other functions for creating decks: create_deck()

Examples

if (FALSE) { # interactive()
# \donttest{
# Display terms then descriptions
flashcard("data_types")

# Display descriptions then terms
flashcard("data_types", termsfirst = FALSE)

# Display terms without package information
flashcard("data_types", package = FALSE)
# }
}