Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: ask to install tutorial dependencies #253

isteves opened this issue Jul 8, 2019 · 3 comments


Copy link

@isteves isteves commented Jul 8, 2019

Hi! @jules32, @angela-li, and I are working on improving the use_tutorial() function for usethis, which sets up the learnr tutorial package format . Our two main use cases are (1) package developers that want to include tutorials as documentation and (2) course instructors that want to distribute a bundle of tutorials to students.

For course instructors, it's especially important to minimize friction related to package installs. Thus, it would be great if run_tutorial() would prompt the user to install packages that the tutorial depends on.

@cderv recommended 3 options to find the dependencies in the tutorial:

utils::menu() could then be used to ask users if it's okay to install all the dependencies.


This comment has been minimized.

Copy link

@schloerke schloerke commented Jul 8, 2019

This is a great idea!

Do you think packrat::appDependencies would work for this use case?

A difficulty that we have run into for learnr documents is that authors are writing broken code for students to fix. While great for teaching, this is hard to parse. rstudio/packrat#551 fixed this by parsing per chunk vs the whole file. learnr's next release will already have packrat as a suggested dependency to help with this deployment problem, so no new dependency will be needed.

I am open to a PR. Maybe install_tutorial_dependencies(file)?

Please do not include graphics for utils::menu.

Thank you for the help with usethis::use_tutorial()!


This comment has been minimized.

Copy link
Contributor Author

@isteves isteves commented Jul 11, 2019

It looks like packrat:::fileDependencies() will work for this. I hadn't thought of broken code, but it definitely seems like a common use-case in teaching!

I'll see what I can put together 👍

Noted. 😄 Gabor also mentioned that it can be problematic

@isteves isteves mentioned this issue Jul 17, 2019
1 of 3 tasks complete

This comment has been minimized.

Copy link

@cderv cderv commented Jul 30, 2019

This should now be closed by #267.
Thanks for the idea @isteves!

@schloerke schloerke closed this Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.