Skip to contents

To create a data frame of functions that can be used to create a flashcard deck, use build_functions_df(). This function calls extract_functions() to find the functions if the file argument is specified. Otherwise, users can pass a character vector of function names to the fs argument. Either way, a title must be passed to title to create the data frame.

Users can then either complete the description column of the data frame with their own descriptions or set the desc argument to TRUE to use descriptions from flashr_decks.

Usage

build_functions_df(file = NULL, fs = NULL, title, desc = TRUE, omit = TRUE)

Arguments

file

Character string of file name for text that includes code blocks. Can be local file or URL.

fs

If not using a file, character vector of functions [do not include ()].

title

Character string of title for flashcard deck (required)

desc

Logical for whether to search for descriptions from flashr_decks (default is TRUE, which includes descriptions from flashr_decks).

omit

Logical for whether to omit terms that have no descriptions from flashr_decks (default is TRUE, which omits terms with no descriptions).

Value

Data frame suitable to include in flashcard().

See also

Other functions for extracting code and functions: extract_code(), extract_functions()

Examples

build_functions_df(fs = c("apple", "apply", "+"), title = "Test")
#>      term                                                  description package
#> 1       +                                                     addition    base
#> 3 apply() apply a function to multiple elements of an object in base R    base
#>   title
#> 1  Test
#> 3  Test