"Build Package Documentation" shortcut not working


This is a small (but pesky) issue.

I'm making an R package and I've started to work on the documentation using roxygen comments. devtools::document() builds the documentation and lets me preview it, but I'm trying to use the default shortcut 'Ctrl + Shift + D' to do so because I'm continuously editing and it'd be a lot more efficient. For some reason, however, it doesn't work (and nothing happens). I've checked Tools > Modify Keyboard Shortcuts and there is nothing else mapped to that shortcut. Similar shortcuts, like 'Ctrl + Shift + L' to execute devtools::load_all("."), do work, which makes me think that the shortcut I'm looking for is somehow being taken by my computer, but I checked System Preferences > Keyboard > Shortcuts and it reveals no command using this key combination. I also have restarted RStudio, but that didn't work.

These are the specs of what I'm running:

R version 3.6.0 (2019-04-26)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.6

[1] "desktop"
[1] ‘1.2.1335’

Would anybody have any suggestions?

Thank you for your time,

You may need to explicitly check that you've enabled documentation building with devtools. Check within Tools -> Project Options... -> Build Tools; there should be a checkbox:

Generate documentation with Roxygen

Is that preference checked?


It was not! I've selected it and now it works!

Thank you so much :smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.