I have been loading my packages via the import package to prevent clashes. But when I deploy an app or document to RStudio Connect, it seems to need me to specify packages via library() to know which packages to install.
Is there a way to specify required packages for an RStudio Connect deployment, without using library().
Include a file dependencies.R with your application or document and include library(dependency) for each package dependency. That file is not loaded by your content, but its presence in the deployment is enough for rsconnect+packrat to list those packages as required.
The packrat package is responsible for identifying dependencies within your content; it does not know about the import package or how it adds packages.
Until the reference packrat issue is solved, the dependencies.R option is the most straightforward way to get your dependencies correctly enumerated. Unfortunately, it means declaring those references in two places.