In order to encourage myself to review vocab words more often, I wrote a function that calls utils::menu() and placed it in my RProfile. That way, I would be asked about vocabulary every time I restart my R session.
However, this seems to lead to a weird error with View() (related GitHub issue at https://github.com/isteves/flashcards/issues/1):
> View(mtcars)
Error in hist(hist_vals, plot = FALSE) : could not find function "hist"
I suspect that by running utils::menu(), I'm somehow blocking some start-up processes that normally run.
Any insight into this problem would be great!
To reproduce this problem:
-
usethis::edit_r_profile() to open your RProfile
- Comment out whatever is already there and add:
if(interactive()) {
utils::menu(c("apple", "orange", "carambola"), title = "pick a fruit")
}
- Restart R
- Run
View(mtcars)