I was able to replicate this behavior with the code2r package:
-
When installed with devtools::install_github(), the RStudio Addin is instantly added in the Addins menu. The package namespace does not even need to be loaded for this change to take effect (confirmed via isNamespaceLoaded("code2r"))
-
When installed with devtools::install(), the Addin is not instantly available in the Addins menu. Even attaching the package does not add it. The RStudio Session has to be restarted (Ctrl-Shift-F10) for the Addin to be included in the menu.
Furthermore, I tried devtools::install_local(), since I expected this to behave more like install_github(). However, it too required that the R session be restarted before the RStudio Addin was available.
Thus in the short-term, I'd recommend restarting the session after installing your package (and documenting in the installation instructions that this will be necessary if the user performs a local installation).
In the long-term, if you really wanted to know what was causing the difference, my suspicion is that RStudio is performing some magic behind the scenes. It uses hooks to have more control over various installation functions, so I suspect that install_github() intersects one of these special functions.
> install.packages
function (...)
.rs.callAs(name, hook, original, ...)
<environment: 0x555d1ce0cb38>
> remove.packages
function (...)
.rs.callAs(name, hook, original, ...)
<environment: 0x555d1ce11558>
That being said, I tried running debugonce(install.packages) prior to running the installation commands, and wasn't entered into the debugger, so it's totally possible my theory is totally off.
I obtained the above results using the Docker image rocker/tidyverse, running Debian 10, R 3.6.3, RStudio Server 1.2.5042, devtools 2.3.0, and remotes 2.1.1.