flashcard | R Documentation |
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.
flashcard(
x,
termsfirst = TRUE,
package = TRUE,
theme = "moon",
file = NULL,
random = TRUE,
fontsize = "default",
fontcolor = NULL,
linkcolor = NULL,
use_browser = FALSE,
omit_na = TRUE
)
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) |
random |
Logical indicating whether to randomize order of terms (TRUE) or use order from data frame |
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) |
omit_na |
Logical indicating whether to omit terms that have no descriptions from the deck (default is TRUE, which omits terms with no descriptions) |
An HTML file of terms and descriptions rendered in the RStudio viewer or web browser.
This function requires internet connectivity to use existing decks. An internet connection is not required if you supply a CSV file. However, without an internect connection, themes other than black, white, and serif, may not render properly, as they require access to Google Fonts.
Other functions for creating decks:
create_deck()
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.