The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
A convenient API to create guided tours of Shiny applications using driver.js, visit the website for more details.
Let’s create a very basic Shiny app to demonstrate: it takes a text input and on hitting a button simply prints it.
library(shiny)
<- fluidPage(
ui textInput("text_inputId", "Enter some text"),
actionButton("submit_inputId", "Submit text"),
verbatimTextOutput("print")
)
<- function(input, output){
server <- eventReactive(input$submit_inputId, {
txt $text_inputId
input
})
$print <- renderPrint(txt())
output
}
shinyApp(ui, server)
Now we can create a guide to walk the user through the application:
simply initialise a new guide from the Cicerone
object then
add steps
.
library(cicerone)
<- Cicerone$
guide new()$
step(
el = "text_inputId",
title = "Text Input",
description = "This is where you enter the text you want to print."
$
)step(
"submit_inputId",
"Send the Text",
"Send the text to the server for printing"
)
This is our guide created, we can now include it the Shiny app we
created earlier and start the guide. Note to that you need to include
use_cicerone
in your UI.
library(shiny)
<- fluidPage(
ui use_cicerone(), # include dependencies
textInput("text_inputId", "Enter some text"),
actionButton("submit_inputId", "Submit text"),
verbatimTextOutput("print")
)
<- function(input, output){
server
# initialise then start the guide
$init()$start()
guide
<- eventReactive(input$submit_inputId, {
txt $text_inputId
input
})
$print <- renderPrint(txt())
output
}
shinyApp(ui, server)
All options are detailed in the documentation of the object:
?Cicerone
. See the site for more
information.
You can install the stable version from CRAN with:
install.packages("cicerone")
You can install the development version from Github with:
# install.packages("remotes")
::install_github("JohnCoene/cicerone") remotes
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.