A demo of using plumbertableau to create APIs that Tableau can consume.
- Code: https://github.com/SamEdwardes/demo-plumber-penguins
- API Deployment: https://colorado.rstudio.com/rsc/demo-plumber-tableau-penguins/
- Tableau Deployment: https://us-west-2b.online.tableau.com/#/site/rstudio/workbooks/472632?:origin=card_share_link
After making any code changes run the following:
renv::snapshot()
rsconnect::writeManifest("app")
Next, push your changes to git. RStudio Connect will then automatically redeploy the app.
You can also deploy the app using the rsconnect api:
rsconnect::deployAPI(
api = "app",
appFiles = c("plumber.R"),
appTitle = "Plumber Tableau Penguins"
)
After deploying the API follow the instructions from https://rstudio.github.io/plumbertableau/articles/tableau-developer-guide.html to deploy in Tableau. For example, you must consider Tableau to use Connect as an Analytics Extension:
Create a field named Selected Dimension Value
that will allow users to change which field they want to identify outliers based on.
Create a field named Is Outlier?
which calls the plumber API using the SCRIPT_BOOL
function. For each row in the data this will return TRUE
or FALSE
. Values that are TRUE
are outliers.
Construct the scatter plot that colors each data point based on its outlier status.