Simulações web interativas com R
25/11/2025
install.packages("shiny")
library(shiny)
ui <- fluidPage(
"Olá, esse é o primeiro aplicativo da disciplina cen0440!"
)
server <- function(input, output, session) {
}
shinyApp(ui, server)Ao rodar, o Shiny:
numericInput() – númerostextInput() – textossliderInput() – intervalosselectInput() – escolha única ou múltiplacheckboxGroupInput() – múltiplas seleçõestextOutput() – textoverbatimTextOutput() – console formatadoplotOutput() – gráficostableOutput() – tabelasdataTableOutput() – tabelas interativasfluidPage()sidebarLayout()tabsetPanel()navbarPage()bslib::card() e layout_sidebar() (moderno)Note que cada exemplo explora ferramentas diferentes!
runExample("01_hello") # a histogram
runExample("02_text") # tables and data frames
runExample("03_reactivity") # a reactive expression
runExample("04_mpg") # global variables
runExample("05_sliders") # slider bars
runExample("06_tabsets") # tabbed panels
runExample("07_widgets") # help text and submit buttons
runExample("08_html") # Shiny app built from HTML
runExample("09_upload") # file upload wizard
runExample("10_download") # file download wizard
runExample("11_timer") # an automated timerrsconnect::deployApp()reactive() para cálculos reutilizáveisExistem vários pacotes que permitem personalizar o seu aplicativo, permitindo, entre outras coisas, mudar tema e cores, inserir caixas informativas e botões com diferentes estilos. Alguns são:
CEN0440 - Estatística de Bioensaios