knitr::opts_chunk$set(echo = TRUE)
Excited to make an app to explore data together? You've come to the right place.
burro
has a function called build_shiny_app
that will do most of the building for you. Let's run through that process. Here's the steps required to build an app.
burro
Appshinyapps.io
. In RStudio, make a new project by going to File >> New Project and Choose "New Folder". Name the folder what you want your app to be named.
library(burro)
Let's name our project "diamonds".
We're going to use the diamonds
dataset from the ggplot2
package. In the console, type the following:
library(ggplot2) data(diamonds) head(diamonds)
Your dataset may have too many covariates. Here's your chance to whittle them down.
colnames(diamonds)
We're going to specify our covariates as
covars <- c("carat", "cut", "color", "clarity", "depth", "table", "price")
You'll now need to choose your outcome variable, which currently needs to be a factor
(categorical) variable. All of the visualizations in burro
are in terms of this outcome.
We're going to focus on the cut
type of the diamond.
outcome <- "cut"
With everything specified, we can now build our app in our current project.
build_shiny_app(dataset = diamonds, covariates=covars, outcome_var=outcome)
Check to make sure that there's an app.R
in your main project folder and there is a dataset.rds
file in your data
folder inside your project.
Open the app.R
file and hit the Run App
button. Your app should pop up. Try it out!
shinyapps.io
Your burro
project is now ready to be deployed to a Shiny Server! We'll focus on Shinyapps.io because it's free. You'll need to follow the directions here: https://docs.rstudio.com/shinyapps.io/getting-started.html (signing up, installing the rsconnect
package, setting it up) to get started.
Once all that is setup, you can hit the "Publish" button or use deployApp()
to publish it to your Shinyapps.io
account.
Your burro
app is now ready to share at your url. Send it out and have a data scavenger hunt!
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.