Use vetiver_deploy_rsconnect()
to deploy a vetiver_model()
that has been
versioned and stored via vetiver_pin_write()
as a Plumber API on RStudio
Connect.
Arguments
- board
A pin board, created by
board_folder()
,board_connect()
,board_url()
or anotherboard_
function.- name
Pin name.
- version
Retrieve a specific version of a pin. Use
pin_versions()
to find out which versions are available and when they were created.- predict_args
A list of optional arguments passed to
vetiver_api()
such as the predictiontype
.- appTitle
The API title on Posit Connect. Use the default based on
name
, or pass in your own title.- ...
Other arguments passed to
rsconnect::deployApp()
such asappName
,account
, orlaunch.browser
.
Details
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.
Examples
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)
#> Creating new version '20230912T161303Z-8ba03'
#> Writing to pin 'cars_linear'
#>
#> Create a Model Card for your published model
#> • Model Cards provide a framework for transparent, responsible reporting
#> • Use the vetiver `.Rmd` template as a place to start
#> This message is displayed once per session.
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"
)
}