vetiver_deploy_rsconnect | R Documentation |
Use vetiver_deploy_rsconnect()
to deploy a vetiver_model()
that has been
versioned and stored via vetiver_pin_write()
as a Plumber API on Posit Connect.
vetiver_deploy_rsconnect(
board,
name,
version = NULL,
predict_args = list(),
appTitle = glue::glue("{name} model API"),
...,
additional_pkgs = character(0)
)
board |
A pin board, created by |
name |
Pin name. |
version |
Retrieve a specific version of a pin. Use |
predict_args |
A list of optional arguments passed to |
appTitle |
The API title on Posit Connect. Use the default based on
|
... |
Other arguments passed to |
additional_pkgs |
Any additional R packages that need to be attached
via |
The two functions vetiver_deploy_rsconnect()
and
vetiver_create_rsconnect_bundle()
are alternatives to each other, providing
different strategies for deploying a vetiver model API to Posit Connect.
When you first deploy to Connect, your API will only be accessible to you. You can change the access settings so others can also access the API. For all access settings other than "Anyone - no login required", anyone querying your API (including you) will need to pass authentication details with your API call, as shown in the Connect documentation.
The deployment success (TRUE
or FALSE
), invisibly.
vetiver_write_plumber()
, vetiver_create_rsconnect_bundle()
library(pins)
b <- board_temp(versioned = TRUE)
cars_lm <- lm(mpg ~ ., data = mtcars)
v <- vetiver_model(cars_lm, "cars_linear")
vetiver_pin_write(b, v)
if (FALSE) {
## pass args for predicting:
vetiver_deploy_rsconnect(
b,
"user.name/cars_linear",
predict_args = list(debug = TRUE)
)
## specify an account name through `...`:
vetiver_deploy_rsconnect(
b,
"user.name/cars_linear",
account = "user.name"
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.