Package 'flashr'

Title: Create Flashcards of Terms and Definitions
Description: Provides functions for creating flashcard decks of terms and definitions. This package creates HTML slides using 'revealjs' that can be viewed in the 'RStudio' viewer or a web browser. Users can create flashcards from either existing built-in decks or create their own from CSV files or vectors of function names.
Authors: Jeffrey R. Stevens [aut, cre, cph]
Maintainer: Jeffrey R. Stevens <[email protected]>
License: MIT + file LICENSE
Version: 0.1.2
Built: 2024-11-10 03:44:51 UTC
Source: https://github.com/jeffreyrstevens/flashr

Help Index


Choose from available flashcard decks

Description

This function prints a list of flashcard decks to the console and let's the user choose one of the decks. By default, the function searches the flashr_decks repo. But other GitHub repos can be used.

To narrow the results, include text in the pattern argument (for example, choose_deck(pattern = "r4ds")).

Usage

choose_deck(
  pattern = NULL,
  choice = NULL,
  repo = "JeffreyRStevens/flashr_decks"
)

Arguments

pattern

String pattern to search in list of decks.

choice

Integer value of choice from list of decks if you already know which deck you would like to use without listing again.

repo

GitHub username and repo for deck repository in the format of "username/repository". Default value is "JeffreyRStevens/flashr_decks".

Value

Outputs a list of available built-in flashcard decks to the console, where the user can choose one of the decks to generate flashcards.

See Also

Other functions for finding decks: list_decks()

Examples

## Not run: 
# Choose from all available decks in default repository
choose_deck()

# Choose from decks including text matching pattern
choose_deck(pattern = "r4ds")

# Choose from decks from specific repository
choose_deck(repo = "JeffreyRStevens/flashr_decks")

## End(Not run)

Create deck from vector of functions

Description

The create_deck() function generates a set of flashcards with randomly ordered pairs of terms and descriptions from a vector of functions provided by the user. 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

create_deck(
  x,
  title = NULL,
  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

title

Title provided for flashcard deck. Defaults to "Custom deck" if not provided.

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: flashcard()

Examples

# Display terms then descriptions
my_functions <- c("as_tibble()", "bind_rows()", "c()")
create_deck(x = my_functions)

# Customize the title
create_deck(x = my_functions, title = "My deck")

# Save the HTML version of the flashcard deck locally
create_deck(x = my_functions, title = "My deck", file = "my_deck.html")

Data types deck

Description

This flashcard deck includes terms associated with data types and structures.

Usage

data_types

Format

A data frame with 4 columns.

term

reference term or function

description

description or definition of term

url

URL for function documentation

package

package including function/argument

title

title of deck


Create flashcards

Description

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

# 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)

List available available flashcard decks

Description

This function searches for flashcard decks stored in GitHub repositories. By default, the function searches the flashr_decks repo. But other GitHub repos can be used.

To narrow the results, include text in the pattern argument (for example, list_decks(pattern = "r4ds")).

Usage

list_decks(
  pattern = NULL,
  repo = "JeffreyRStevens/flashr_decks",
  quiet = FALSE
)

Arguments

pattern

String pattern to search in list of decks.

repo

GitHub username and repo for deck repository in the format of "username/repository". Default value is "JeffreyRStevens/flashr_decks".

quiet

Logical to prevent list information from printing to console.

Details

You are welcome to fork the flashr_decks repo and modify or add your own decks. Or you can create your own repo from scratch. Just make sure to place your decks in a directory called ⁠decks/⁠ in your root directory. Then set the repo argument to your username and repo (see Examples).

Value

Outputs a list of available built-in flashcard decks to the console.

See Also

Other functions for finding decks: choose_deck()

Examples

# View all available decks
list_decks()

# View decks with text matching pattern
list_decks(pattern = "r4ds")

# View decks from specific repository
list_decks(repo = "JeffreyRStevens/flashr_decks")

Vectors deck

Description

This flashcard deck includes terms associated with vectors.

Usage

vectors

Format

A data frame with 4 columns.

term

reference term or function

description

description or definition of term

package

package including function/argument

title

title of deck