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 |
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")
).
choose_deck( pattern = NULL, choice = NULL, repo = "JeffreyRStevens/flashr_decks" )
choose_deck( pattern = NULL, choice = NULL, repo = "JeffreyRStevens/flashr_decks" )
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". |
Outputs a list of available built-in flashcard decks to the console, where the user can choose one of the decks to generate flashcards.
Other functions for finding decks:
list_decks()
## 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)
## 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)
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.
create_deck( x, title = NULL, termsfirst = TRUE, package = TRUE, theme = "moon", file = NULL, fontsize = "default", fontcolor = NULL, linkcolor = NULL, use_browser = FALSE )
create_deck( x, title = NULL, termsfirst = TRUE, package = TRUE, theme = "moon", file = NULL, fontsize = "default", fontcolor = NULL, linkcolor = NULL, use_browser = FALSE )
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) |
An HTML file of terms and descriptions rendered in the RStudio viewer or web browser.
Other functions for creating decks:
flashcard()
# 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")
# 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")
This flashcard deck includes terms associated with data types and structures.
data_types
data_types
A data frame with 4 columns.
reference term or function
description or definition of term
URL for function documentation
package including function/argument
title of deck
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, fontsize = "default", fontcolor = NULL, linkcolor = NULL, use_browser = FALSE )
flashcard( x, termsfirst = TRUE, package = TRUE, theme = "moon", file = NULL, fontsize = "default", fontcolor = NULL, linkcolor = NULL, use_browser = FALSE )
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) |
An HTML file of terms and descriptions rendered in the RStudio viewer or web browser.
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)
# 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)
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")
).
list_decks( pattern = NULL, repo = "JeffreyRStevens/flashr_decks", quiet = FALSE )
list_decks( pattern = NULL, repo = "JeffreyRStevens/flashr_decks", quiet = FALSE )
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. |
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).
Outputs a list of available built-in flashcard decks to the console.
Other functions for finding decks:
choose_deck()
# 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")
# 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")
This flashcard deck includes terms associated with vectors.
vectors
vectors
A data frame with 4 columns.
reference term or function
description or definition of term
package including function/argument
title of deck