External Package configuration

Hello,

When setting up external packages in the config file on Rstudio Connect what is the recommended package set up in a markdown file that gets published? I am trying to set up the magick package as external so that version 1.9 is used by published content utilizing the package. Thanks!

Hey @jvail! Apologies for the delay in responding to your message here!

I'm not sure I have 100% parsed your question properly. It seems you have set up magick as an ExternalPackage in the /etc/rstudio-connect/rstudio-connect.gcfg file?

In order to do that, you need to install magick into every R version installed on your RStudio Connect server. Typically this is done by "assuming root" (sudo su) and then installing the package.

Once that is done, you shouldn't have to do anything else! Just publish as usual, and Connect will "ignore" installing magick when it is rebuilding an app environment. Please keep in mind that this means all content for any given version of R will use the exact same version of the package. Further, changing that version will simultaneously affect all content using that R version.

Do you mind saying a bit more about why you are installing magick as an external package? Has it been a trouble to install?

Did I understand your question properly?

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

Awesome!! Thanks for the update @jvail! That is exactly the right solution!

The other thing you could do to install a dedicated version in the future is something like:

remotes::install_version("magick", "1.9")

One last thing to keep in mind - it is possible to install multiple versions of R side-by-side on Connect. Connect will choose the closest version to build your content in when you deploy, so there is little downside in doing so. Just a bit of the admin's time required :smiley:

It's a pretty quick operation, so just wanted to be sure you had this information at your disposal!

https://docs.rstudio.com/resources/install-r/

1 Like

Hi Cole, yes you understood the question. We have only one version of R installed on the Connect server and it wasn't working with the newest version of the magick package. We solved the problem by explicitly installing an earlier version of the package in the app after trying the external package setting in the config file. With more recent versions of R I don't think this would be a problem.
Here's what we used to solve it until we get additional versions of R installed.
magick <- "https://cran.r-project.org/src/contrib/Archive/magick/magick_1.9.tar.gz"
install.packages(magick, repos=NULL, type="source")

1 Like