appDependencies {rsconnect} | R Documentation |
Recursively detect all package dependencies for an application. This function parses all .R files in the application directory to determine what packages the application depends on; and for each of those packages what other packages they depend on.
appDependencies(appDir = getwd(), appFiles = NULL)
appDir |
Directory containing application. Defaults to current working directory. |
appFiles |
The files and directories to bundle and deploy (only if
|
Dependencies are determined by parsing application source code and
looking for calls to library
, require
, ::
, and
:::
.
Recursive dependencies are detected by examining the Depends
,
Imports
, and LinkingTo
fields of the packages immediately
dependend on by the application.
Returns a data frame listing the package dependencies detected for the application:
package
| Name of package |
version | Version of package |
Since the Suggests
field is not included when determining
recursive dependencies of packages, it's possible that not every package
required to run your application will be detected.
In this case, you can force a package to be included dependency by
inserting call(s) to require
within your source directory. This code
need not actually execute, for example you could create a standalone file
named dependencies.R
with the following code:
require(xts)
require(colorspace)
This will force the xts
and colorspace
packages to be
installed along with the rest of your application when it is deployed.
## Not run: # dependencies for the app in the current working dir appDependencies() # dependencies for an app in another directory appDependencies("~/projects/shiny/app1") ## End(Not run)