Building and managing R function dependencies
Pre-installed packages
The R function runtime has the following set of pre-installed packages that can be used in the function code:
httr
, logging
, data.table
, dplyr
, paws
, rjson
, stringr
, BiocManager
, ggplot2
, plotly
, devtools
, Rcpp
, tidyr
, lubridate
, e1071
, caret
, mongolite
, Rsamtools
.
Installing additional packages
When creating a new function version, Cloud Functions lets you install dependencies required for the function to run. To do this, place a file named packages.R
that describes the installation process into the project root.
The service also supports manual delivery of dependencies along with the source code.
packages.R
This script is executed once when creating a function version.
Example packages.R
package install:
install.packages("purrr", repo="http://cran.r-project.org")
Manual delivery of dependencies
To configure dependencies manually, place the compiled packages in the usr/library/
subdirectory of the project archive.
The process of installing dependencies has resource and execution time limits. For more information, see Quotas and limits in Cloud Functions. You can view the dependency installation log using the link that appears in the list of operations.