# flashr

    library(flashr)

Flashcards are a great way to learn information. The repetition of exposure to technical terms and their descriptions/definitions helps with remembering those relationships (Yüksel et al., 2020)1. Hermans (2021)2 suggests using flashcards for learning programming languages, which inspired the `{flashr}` package. The aim of this package is to create a simple way to use and generate new decks of flashcards for learning R function or anything else you want to learn!

## Usage

`{flashr}` has a number of built-in flashcard decks to help you learn R, and especially the tidyverse. The workhorse of the package is the `flashcard()` function, which uses reveal.js3 to generate an HTML presentation displaying terms and descriptions. For RStudio users, the flashcard presentation will appear in the Viewer pane. Outside of RStudio, the function will open the presentation in your default browser. In either case, you can advance slides with the right arrow key or by clicking the right arrow in the presentation.

For example, to create a set of flashcards from the built-in `data_types` deck, simply run:

    flashcard("data_types")

The presentation will start with the title of the deck, then give a blank slide, then present the first term, followed by the description, and a blank slide. The order of terms/descriptions is randomized when the `flashcard()` function is run, so just re-run it to generate a different order.

### Guess the term

By default, terms are presented before descriptions. So when you see a term, you should try to define/describe the term. But it is possible to present descriptions first so you can guess the term by including the `termfirst = FALSE` argument.

    flashcard("data_types", termsfirst = FALSE)

### Including package names

Another feature of `flashcard()` is that it can present the name of the package for each function. Often this is useful to distinguish base R function from functions that require other packages. By default, presentations include the package names. However, you can turn this off with `package = FALSE`.

    flashcard("data_types", package = FALSE)

### Themes

Because `{flashr}` uses reveal.js to create the presentations, it can use the available reveal.js themes. By default, `flashcard()` uses the `moon` theme, but if that doesn’t suit you, you can change the theme by setting the `theme` argument. At the moment, available themes are `black`, `white`, `league`, `beige`, `sky`, `night`, `serif`, `simple`, `solarized`, `blood`, and `moon`.

    flashcard("data_types", theme = "sky")

## Available decks

Currently, `{flashr}` includes a few example decks (`data_types`, `vectors`) and decks of functions and arguments derived from R for Data Science (first edition) and R for Data Science, second edition. These decks are housed at the flashr_decks GitHub repo.

To see what decks are available, use `list_decks()`:

    list_decks()
    #> Available flashcard decks
    #> 1. Data types (data_types)
    #> 2. Operators (operators)
    #> 3. psyteachr_ads Ch. 01 (psyteachr_ads01)
    #> 4. psyteachr_ads Ch. 02 (psyteachr_ads02)
    #> 5. psyteachr_ads Ch. 03 (psyteachr_ads03)
    #> 6. psyteachr_ads Ch. 04 (psyteachr_ads04)
    #> 7. psyteachr_ads Ch. 07 (psyteachr_ads07)
    #> 8. psyteachr_ads Ch. 08 (psyteachr_ads08)
    #> 9. psyteachr_ads Ch. 09 (psyteachr_ads09)
    #> 10. psyteachr_ads Ch. 10 (psyteachr_ads10)
    #> 11. psyteachr_dsrr Ch. 01 (psyteachr_dsrr01)
    #> 12. psyteachr_dsrr Ch. 02 (psyteachr_dsrr02)
    #> 13. psyteachr_dsrr Ch. 03 (psyteachr_dsrr03)
    #> 14. psyteachr_dsrr Ch. 04 (psyteachr_dsrr04)
    #> 15. psyteachr_dsrr Ch. 05 (psyteachr_dsrr05)
    #> 16. psyteachr_dsrr Ch. 06 (psyteachr_dsrr06)
    #> 17. psyteachr_dsrr Ch. 07 (psyteachr_dsrr07)
    #> 18. psyteachr_dsrr Ch. 08 (psyteachr_dsrr08)
    #> 19. psyteachr_dsrr Ch. 09 (psyteachr_dsrr09)
    #> 20. psyteachr_dsrr Ch. 10 (psyteachr_dsrr10)
    #> 21. psyteachr_fqa Ch. 01 (psyteachr_fqa01)
    #> 22. psyteachr_fqa Ch. 02 (psyteachr_fqa02)
    #> 23. psyteachr_fqa Ch. 03 (psyteachr_fqa03)
    #> 24. psyteachr_fqa Ch. 04 (psyteachr_fqa04)
    #> 25. psyteachr_fqa Ch. 05 (psyteachr_fqa05)
    #> 26. psyteachr_fqa Ch. 06 (psyteachr_fqa06)
    #> 27. psyteachr_fqa Ch. 07 (psyteachr_fqa07)
    #> 28. psyteachr_fqa Ch. 08 (psyteachr_fqa08)
    #> 29. psyteachr_fqa Ch. 09 (psyteachr_fqa09)
    #> 30. psyteachr_fqa Ch. 10 (psyteachr_fqa10)
    #> 31. psyteachr_fqa Ch. 11 (psyteachr_fqa11)
    #> 32. psyteachr_fqa Ch. 12 (psyteachr_fqa12)
    #> 33. psyteachr_fqa Ch. 13 (psyteachr_fqa13)
    #> 34. psyteachr_fqa Ch. 14 (psyteachr_fqa14)
    #> 35. psyteachr_fqa Ch. 15 (psyteachr_fqa15)
    #> 36. R4DS-2e Ch. 00 (r4ds-2e00)
    #> 37. R4DS-2e Ch. 01 (r4ds-2e01)
    #> 38. R4DS-2e Ch. 02 (r4ds-2e02)
    #> 39. R4DS-2e Ch. 03 (r4ds-2e03)
    #> 40. R4DS-2e Ch. 04 (r4ds-2e04)
    #> 41. R4DS-2e Ch. 05 (r4ds-2e05)
    #> 42. R4DS-2e Ch. 07 (r4ds-2e07)
    #> 43. R4DS-2e Ch. 09 (r4ds-2e09)
    #> 44. R4DS-2e Ch. 10 (r4ds-2e10)
    #> 45. R4DS-2e Ch. 11 (r4ds-2e11)
    #> 46. R4DS-2e Ch. 12 (r4ds-2e12)
    #> 47. R4DS-2e Ch. 13 (r4ds-2e13)
    #> 48. R4DS-2e Ch. 14 (r4ds-2e14)
    #> 49. R4DS-2e Ch. 15 (r4ds-2e15)
    #> 50. R4DS-2e Ch. 16 (r4ds-2e16)
    #> 51. R4DS-2e Ch. 17 (r4ds-2e17)
    #> 52. R4DS-2e Ch. 18 (r4ds-2e18)
    #> 53. R4DS-2e Ch. 19 (r4ds-2e19)
    #> 54. R4DS-2e Ch. 20 (r4ds-2e20)
    #> 55. R4DS-2e Ch. 21 (r4ds-2e21)
    #> 56. R4DS-2e Ch. 22 (r4ds-2e22)
    #> 57. R4DS-2e Ch. 23 (r4ds-2e23)
    #> 58. R4DS-2e Ch. 24 (r4ds-2e24)
    #> 59. R4DS-2e Ch. 25 (r4ds-2e25)
    #> 60. R4DS-2e Ch. 26 (r4ds-2e26)
    #> 61. R4DS-2e Ch. 27 (r4ds-2e27)
    #> 62. R4DS-2e Ch. 28 (r4ds-2e28)
    #> 63. R4DS-2e Ch. 29 (r4ds-2e29)
    #> 64. R4DS Ch. 1 (r4ds01)
    #> 65. R4DS Ch. 3 (r4ds03)
    #> 66. R4DS Ch. 5 (r4ds05)
    #> 67. R4DS Ch. 7 (r4ds07)
    #> 68. R4DS Ch. 8 (r4ds08)
    #> 69. R4DS Ch. 10 (r4ds10)
    #> 70. R4DS Ch. 11 (r4ds11)
    #> 71. R4DS Ch. 12 (r4ds12)
    #> 72. R4DS Ch. 13 (r4ds13)
    #> 73. R4DS Ch. 14 (r4ds14)
    #> 74. R4DS Ch. 15 (r4ds15)
    #> 75. R4DS Ch. 16 (r4ds16)
    #> 76. R4DS Ch. 18 (r4ds18)
    #> 77. R4DS Ch. 19 (r4ds19)
    #> 78. R4DS Ch. 20 (r4ds20)
    #> 79. R4DS Ch. 21 (r4ds21)
    #> 80. R4DS Ch. 23 (r4ds23)
    #> 81. R4DS Ch. 25 (r4ds25)
    #> 82. R4DS Ch. 27 (r4ds27)
    #> 83. R4DS Ch. 28 (r4ds28)
    #> 84. R4DS Ch. 29 (r4ds29)
    #> 85. R4DS Ch. 30 (r4ds30)
    #> 86. Vectors (vectors)

Note that the list of decks includes the deck names in parenthesis next to the descriptions. For instance, for R4DS Chapter 3, the name is `r4ds03`.

This function includes pattern matching. So if you want to narrow you list down, add a search string.

    list_decks(pattern = "r4ds")
    #> Available flashcard decks
    #> 1. R4DS-2e Ch. 00 (r4ds-2e00)
    #> 2. R4DS-2e Ch. 01 (r4ds-2e01)
    #> 3. R4DS-2e Ch. 02 (r4ds-2e02)
    #> 4. R4DS-2e Ch. 03 (r4ds-2e03)
    #> 5. R4DS-2e Ch. 04 (r4ds-2e04)
    #> 6. R4DS-2e Ch. 05 (r4ds-2e05)
    #> 7. R4DS-2e Ch. 07 (r4ds-2e07)
    #> 8. R4DS-2e Ch. 09 (r4ds-2e09)
    #> 9. R4DS-2e Ch. 10 (r4ds-2e10)
    #> 10. R4DS-2e Ch. 11 (r4ds-2e11)
    #> 11. R4DS-2e Ch. 12 (r4ds-2e12)
    #> 12. R4DS-2e Ch. 13 (r4ds-2e13)
    #> 13. R4DS-2e Ch. 14 (r4ds-2e14)
    #> 14. R4DS-2e Ch. 15 (r4ds-2e15)
    #> 15. R4DS-2e Ch. 16 (r4ds-2e16)
    #> 16. R4DS-2e Ch. 17 (r4ds-2e17)
    #> 17. R4DS-2e Ch. 18 (r4ds-2e18)
    #> 18. R4DS-2e Ch. 19 (r4ds-2e19)
    #> 19. R4DS-2e Ch. 20 (r4ds-2e20)
    #> 20. R4DS-2e Ch. 21 (r4ds-2e21)
    #> 21. R4DS-2e Ch. 22 (r4ds-2e22)
    #> 22. R4DS-2e Ch. 23 (r4ds-2e23)
    #> 23. R4DS-2e Ch. 24 (r4ds-2e24)
    #> 24. R4DS-2e Ch. 25 (r4ds-2e25)
    #> 25. R4DS-2e Ch. 26 (r4ds-2e26)
    #> 26. R4DS-2e Ch. 27 (r4ds-2e27)
    #> 27. R4DS-2e Ch. 28 (r4ds-2e28)
    #> 28. R4DS-2e Ch. 29 (r4ds-2e29)
    #> 29. R4DS Ch. 1 (r4ds01)
    #> 30. R4DS Ch. 3 (r4ds03)
    #> 31. R4DS Ch. 5 (r4ds05)
    #> 32. R4DS Ch. 7 (r4ds07)
    #> 33. R4DS Ch. 8 (r4ds08)
    #> 34. R4DS Ch. 10 (r4ds10)
    #> 35. R4DS Ch. 11 (r4ds11)
    #> 36. R4DS Ch. 12 (r4ds12)
    #> 37. R4DS Ch. 13 (r4ds13)
    #> 38. R4DS Ch. 14 (r4ds14)
    #> 39. R4DS Ch. 15 (r4ds15)
    #> 40. R4DS Ch. 16 (r4ds16)
    #> 41. R4DS Ch. 18 (r4ds18)
    #> 42. R4DS Ch. 19 (r4ds19)
    #> 43. R4DS Ch. 20 (r4ds20)
    #> 44. R4DS Ch. 21 (r4ds21)
    #> 45. R4DS Ch. 23 (r4ds23)
    #> 46. R4DS Ch. 25 (r4ds25)
    #> 47. R4DS Ch. 27 (r4ds27)
    #> 48. R4DS Ch. 28 (r4ds28)
    #> 49. R4DS Ch. 29 (r4ds29)
    #> 50. R4DS Ch. 30 (r4ds30)

If you want to list the decks and then choose one, use `choose_deck()`:

    choose_deck("r4ds")

    #> Available flashcard decks
    #> 1. R4DS-2e Ch. 00 (r4ds-2e00)
    #> 2. R4DS-2e Ch. 01 (r4ds-2e01)
    #> 3. R4DS-2e Ch. 02 (r4ds-2e02)
    #> 4. R4DS-2e Ch. 03 (r4ds-2e03)
    #> 5. R4DS-2e Ch. 04 (r4ds-2e04)
    #> 6. R4DS-2e Ch. 05 (r4ds-2e05)
    #> 7. R4DS-2e Ch. 07 (r4ds-2e07)
    #> 8. R4DS-2e Ch. 09 (r4ds-2e09)
    #> 9. R4DS-2e Ch. 10 (r4ds-2e10)
    #> 10. R4DS-2e Ch. 11 (r4ds-2e11)
    #> 11. R4DS-2e Ch. 12 (r4ds-2e12)
    #> 12. R4DS-2e Ch. 13 (r4ds-2e13)
    #> 13. R4DS-2e Ch. 14 (r4ds-2e14)
    #> 14. R4DS-2e Ch. 15 (r4ds-2e15)
    #> 15. R4DS-2e Ch. 16 (r4ds-2e16)
    #> 16. R4DS-2e Ch. 17 (r4ds-2e17)
    #> 17. R4DS-2e Ch. 18 (r4ds-2e18)
    #> 18. R4DS-2e Ch. 19 (r4ds-2e19)
    #> 19. R4DS-2e Ch. 20 (r4ds-2e20)
    #> 20. R4DS-2e Ch. 21 (r4ds-2e21)
    #> 21. R4DS-2e Ch. 22 (r4ds-2e22)
    #> 22. R4DS-2e Ch. 23 (r4ds-2e23)
    #> 23. R4DS-2e Ch. 24 (r4ds-2e24)
    #> 24. R4DS-2e Ch. 25 (r4ds-2e25)
    #> 25. R4DS-2e Ch. 26 (r4ds-2e26)
    #> 26. R4DS-2e Ch. 27 (r4ds-2e27)
    #> 27. R4DS-2e Ch. 28 (r4ds-2e28)
    #> 28. R4DS-2e Ch. 29 (r4ds-2e29)
    #> 29. R4DS Ch. 1 (r4ds01)
    #> 30. R4DS Ch. 3 (r4ds03)
    #> 31. R4DS Ch. 5 (r4ds05)
    #> 32. R4DS Ch. 7 (r4ds07)
    #> 33. R4DS Ch. 8 (r4ds08)
    #> 34. R4DS Ch. 10 (r4ds10)
    #> 35. R4DS Ch. 11 (r4ds11)
    #> 36. R4DS Ch. 12 (r4ds12)
    #> 37. R4DS Ch. 13 (r4ds13)
    #> 38. R4DS Ch. 14 (r4ds14)
    #> 39. R4DS Ch. 15 (r4ds15)
    #> 40. R4DS Ch. 16 (r4ds16)
    #> 41. R4DS Ch. 18 (r4ds18)
    #> 42. R4DS Ch. 19 (r4ds19)
    #> 43. R4DS Ch. 20 (r4ds20)
    #> 44. R4DS Ch. 21 (r4ds21)
    #> 45. R4DS Ch. 23 (r4ds23)
    #> 46. R4DS Ch. 25 (r4ds25)
    #> 47. R4DS Ch. 27 (r4ds27)
    #> 48. R4DS Ch. 28 (r4ds28)
    #> 49. R4DS Ch. 29 (r4ds29)
    #> 50. R4DS Ch. 30 (r4ds30)
    #> Please enter the number for a deck or 0 to exit:

Or, if you already know the deck number that you want, you can include it in the `choice` argument.

    choose_deck("r4ds", choice = 2)

Of course, a faster way to do this is to enter the deck name directly into `flashcard()`.

    flashcard("r4ds03")

You can also view examples of all of the decks in HTML.

## Creating your own decks

In addition to built-in decks, you can create your own decks by making a data frame or CSV file with the terms and descriptions or passing a vector of functions from the flashr_decks list of functions.

### Data frame or CSV file

Simply create a data frame or CSV file that includes a column labeled `term` and a column labeled `description`. You can also include a `package` column listing package names and a `title` column to give your presentation a title, but these are optional arguments4. Here is an example of a CSV file with all of the columns.

    my_deck <- read.csv("../inst/extdata/operators.csv")
    knitr::kable(my_deck)

term | description | package | title
--- | --- | --- | ---
= | assignment operator | base | Operators
<- | assignment operator | base |
|> | pipe operator (base R) | base |
+ | addition | base |
- | subtraction | base |
* | multiplication | base |
/ | division | base |
%% | modulo or remainder | base |
%/% | integer division or quotient | base |
^ | exponent | base |
> | greater than | base |
< | less than | base |
<= | greater than or equal to | base |
>= | less than or equal to | base |
== | equal to | base |
!= | not equal to | base |
& | logical AND | base |
| | logical OR | base |
! | logical NOT | base |
: | sequence of integers | base |
%in% | identify if element is in vector | base |
%*% | multiply matrix with its transpose | base |
:: | export variable from package for use | base |

You can, of course, store those decks on your local computer to use them. But if your decks may be useful for other people (for example, based on books or publicly available resources), consider submitting them to the flashr_decks repo.

Alternatively, you can create your own repo of decks and specify with the `repo` argument. Just make sure that your CSV files are saved in a `decks/` folder in your repo’s root directory.

    list_decks(repo = "JeffreyRStevens/flashr_decks")
    #> Available flashcard decks
    #> 1. Data types (data_types)
    #> 2. Operators (operators)
    #> 3. psyteachr_ads Ch. 01 (psyteachr_ads01)
    #> 4. psyteachr_ads Ch. 02 (psyteachr_ads02)
    #> 5. psyteachr_ads Ch. 03 (psyteachr_ads03)
    #> 6. psyteachr_ads Ch. 04 (psyteachr_ads04)
    #> 7. psyteachr_ads Ch. 07 (psyteachr_ads07)
    #> 8. psyteachr_ads Ch. 08 (psyteachr_ads08)
    #> 9. psyteachr_ads Ch. 09 (psyteachr_ads09)
    #> 10. psyteachr_ads Ch. 10 (psyteachr_ads10)
    #> 11. psyteachr_dsrr Ch. 01 (psyteachr_dsrr01)
    #> 12. psyteachr_dsrr Ch. 02 (psyteachr_dsrr02)
    #> 13. psyteachr_dsrr Ch. 03 (psyteachr_dsrr03)
    #> 14. psyteachr_dsrr Ch. 04 (psyteachr_dsrr04)
    #> 15. psyteachr_dsrr Ch. 05 (psyteachr_dsrr05)
    #> 16. psyteachr_dsrr Ch. 06 (psyteachr_dsrr06)
    #> 17. psyteachr_dsrr Ch. 07 (psyteachr_dsrr07)
    #> 18. psyteachr_dsrr Ch. 08 (psyteachr_dsrr08)
    #> 19. psyteachr_dsrr Ch. 09 (psyteachr_dsrr09)
    #> 20. psyteachr_dsrr Ch. 10 (psyteachr_dsrr10)
    #> 21. psyteachr_fqa Ch. 01 (psyteachr_fqa01)
    #> 22. psyteachr_fqa Ch. 02 (psyteachr_fqa02)
    #> 23. psyteachr_fqa Ch. 03 (psyteachr_fqa03)
    #> 24. psyteachr_fqa Ch. 04 (psyteachr_fqa04)
    #> 25. psyteachr_fqa Ch. 05 (psyteachr_fqa05)
    #> 26. psyteachr_fqa Ch. 06 (psyteachr_fqa06)
    #> 27. psyteachr_fqa Ch. 07 (psyteachr_fqa07)
    #> 28. psyteachr_fqa Ch. 08 (psyteachr_fqa08)
    #> 29. psyteachr_fqa Ch. 09 (psyteachr_fqa09)
    #> 30. psyteachr_fqa Ch. 10 (psyteachr_fqa10)
    #> 31. psyteachr_fqa Ch. 11 (psyteachr_fqa11)
    #> 32. psyteachr_fqa Ch. 12 (psyteachr_fqa12)
    #> 33. psyteachr_fqa Ch. 13 (psyteachr_fqa13)
    #> 34. psyteachr_fqa Ch. 14 (psyteachr_fqa14)
    #> 35. psyteachr_fqa Ch. 15 (psyteachr_fqa15)
    #> 36. R4DS-2e Ch. 00 (r4ds-2e00)
    #> 37. R4DS-2e Ch. 01 (r4ds-2e01)
    #> 38. R4DS-2e Ch. 02 (r4ds-2e02)
    #> 39. R4DS-2e Ch. 03 (r4ds-2e03)
    #> 40. R4DS-2e Ch. 04 (r4ds-2e04)
    #> 41. R4DS-2e Ch. 05 (r4ds-2e05)
    #> 42. R4DS-2e Ch. 07 (r4ds-2e07)
    #> 43. R4DS-2e Ch. 09 (r4ds-2e09)
    #> 44. R4DS-2e Ch. 10 (r4ds-2e10)
    #> 45. R4DS-2e Ch. 11 (r4ds-2e11)
    #> 46. R4DS-2e Ch. 12 (r4ds-2e12)
    #> 47. R4DS-2e Ch. 13 (r4ds-2e13)
    #> 48. R4DS-2e Ch. 14 (r4ds-2e14)
    #> 49. R4DS-2e Ch. 15 (r4ds-2e15)
    #> 50. R4DS-2e Ch. 16 (r4ds-2e16)
    #> 51. R4DS-2e Ch. 17 (r4ds-2e17)
    #> 52. R4DS-2e Ch. 18 (r4ds-2e18)
    #> 53. R4DS-2e Ch. 19 (r4ds-2e19)
    #> 54. R4DS-2e Ch. 20 (r4ds-2e20)
    #> 55. R4DS-2e Ch. 21 (r4ds-2e21)
    #> 56. R4DS-2e Ch. 22 (r4ds-2e22)
    #> 57. R4DS-2e Ch. 23 (r4ds-2e23)
    #> 58. R4DS-2e Ch. 24 (r4ds-2e24)
    #> 59. R4DS-2e Ch. 25 (r4ds-2e25)
    #> 60. R4DS-2e Ch. 26 (r4ds-2e26)
    #> 61. R4DS-2e Ch. 27 (r4ds-2e27)
    #> 62. R4DS-2e Ch. 28 (r4ds-2e28)
    #> 63. R4DS-2e Ch. 29 (r4ds-2e29)
    #> 64. R4DS Ch. 1 (r4ds01)
    #> 65. R4DS Ch. 3 (r4ds03)
    #> 66. R4DS Ch. 5 (r4ds05)
    #> 67. R4DS Ch. 7 (r4ds07)
    #> 68. R4DS Ch. 8 (r4ds08)
    #> 69. R4DS Ch. 10 (r4ds10)
    #> 70. R4DS Ch. 11 (r4ds11)
    #> 71. R4DS Ch. 12 (r4ds12)
    #> 72. R4DS Ch. 13 (r4ds13)
    #> 73. R4DS Ch. 14 (r4ds14)
    #> 74. R4DS Ch. 15 (r4ds15)
    #> 75. R4DS Ch. 16 (r4ds16)
    #> 76. R4DS Ch. 18 (r4ds18)
    #> 77. R4DS Ch. 19 (r4ds19)
    #> 78. R4DS Ch. 20 (r4ds20)
    #> 79. R4DS Ch. 21 (r4ds21)
    #> 80. R4DS Ch. 23 (r4ds23)
    #> 81. R4DS Ch. 25 (r4ds25)
    #> 82. R4DS Ch. 27 (r4ds27)
    #> 83. R4DS Ch. 28 (r4ds28)
    #> 84. R4DS Ch. 29 (r4ds29)
    #> 85. R4DS Ch. 30 (r4ds30)
    #> 86. Vectors (vectors)

### Drawing from list of functions

We’ve collected all of the functions in the currently available decks in a table at the flashr_decks repo. The `create_deck()` function takes a vector that you create of functions from the function list. Make sure to include the `()` at the end of the function name (except for operators)! And don’t forget to include a title.

    my_functions <- c("%>%", "ggplot()", "aes()", "geom_point()")
    create_deck(my_functions,
      title = "ggplot basics"
    )

All of the arguments from `flashcard()` apply to `create_deck()`, so you can customize the theme, fonts, etc. and save the output locally.

### Extracting functions from R Markdown and Quarto files

If you want to extract functions from existing R Markdown or Quarto files, you can use `build_functions_df()`. Just pass it either a file path or a URL for an R Markdown or Quarto file, and it will extract those functions and create a data frame that can be passed to `flashcard()` to create a deck. However, to include descriptions, you will either need to pull them from the table at the flashr_decks repo by setting `desc = TRUE` (the default option) or edit the data frame by hand either directly in R or by writing to a CSV, editing the CSV, and importing it again. If there are functions you’d like to see added to the flashr_decks table, let me know.

Note that the `build_functions_df()` function is built on `extract_code()` and `extract_functions()`, which may be useful in other contexts. Use `extract_code()` to extract the contents of all R code blocks in R Markdown and Quarto documents and `extract_functions()` to extract all R functions found in a character vector.

### Expanding your flashcards

These flashcards were designed to learn programming functions/arguments and their definitions. But `{flashr}` can be use for any pairing of terms and descriptions, computing-based or otherwise. So feel free to make flashcard decks of whatever you want to learn: words from a language that you are learning, terms you’re studying for classes, whatever you need!

1. Yüksel, H. G., Mercanoğlu, H. G., & Yılmaz, M. B. (2020). Digital flashcards vs. Wordlists for learning technical vocabulary. Computer Assisted Language Learning, 0(0), 1–17. https://doi.org/10.1080/09588221.2020.1854312↩︎

2. Hermans, F. (2021). The Programmer’s Brain. Manning. https://www.manning.com/books/the-programmers-brain↩︎

3. Via the revealjs R package.↩︎

4. Note `title` is required when submitting to flashr_decks↩︎