The goal of flashcards is to bring some Hebrew into my daily R work. All these words are gathered on the job, so they tend to be related to data science / fraud / e-commerce / programming.
You can install the development version of flashcards
from
GitHub with:
# install.packages("devtools")
devtools::install_github("isteves/flashcards")
The package comes with a single function:
library(flashcards)
test_vocab()
It prompts you for the definition of a vocab word and gives three choices to choose from. For example, like this:
What does מדבג mean?
1: to separate
2: indication
3: debug
Selection: <enter your selection>
To be prompted with a vocab word every time you restart R, use
usethis::edit_r_profile()
to open your .Rprofile file for editing and
add the following line:
if(interactive()) {
setHook("rstudio.sessionInit", function(...) {
flashcards::test_vocab()
})
}
The setHook command is needed because the utils::menu()
function
within test_vocab()
interrupts the RStudio set-up processes. (Thanks
to Kevin Ushey for the solution…more details on RStudio
Community.)
Want to test yourself on your own vocabulary? For the time being, the easiest way is the following:
data-raw/vocab.tsv
with a tsv file of your choice. It
should contain two columns with the following names: test
(the
word that is new to you) and reference
(the definition)vocab.R
script (edit if needed)devtools::install()
(or press “Install and Restart” in the
Build pane in RStudio) to install the package locallyAdd the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.