- Tornar nossas análises interativas
ui <- fluidPage( ... )server <- function(input, output, session) { ... }shinyApp(ui = ui, server = server)data <- read.csv("data.csv")
new_data <- data %>% filter(UF=="SP")
Graph <- new_data() %>% ggplot() +
geom_col(aes(x=NOME_PARTIDO,y=QTDE_VOTOS))
ui <- fluidPage(
)
server <- function(input, output, session) {
}
shinyApp(ui = ui, server = server)
library(tidyverse)
library(knitr)
library(shiny)
ui <- fluidPage(
)
server <- function(input, output, session) {
}
shinyApp(ui = ui, server = server)
library(tidyverse)
library(knitr)
library(shiny)
data <- read.csv("data.csv")
ui <- fluidPage(
)
server <- function(input, output, session) {
}
shinyApp(ui = ui, server = server)
data <- read.csv("data.csv")
ui <- fluidPage(
)
server <- function(input, output, session) {
}
shinyApp(ui = ui, server = server)
data <- read.csv("data.csv")
ui <- fluidPage(
selectInput("Estado",
label="Estado",
choices = c("SP","RJ"),
selected = "SP")
)
server <- function(input, output, session) {
}
shinyApp(ui = ui, server = server)
data <- read.csv("data.csv")
ui <- fluidPage(
selectInput("Estado",
label="Estado",
choices = c("SP","RJ"),
selected = "SP")
)
server <- function(input, output, session) {
new_data <- reactive({
data %>% filter(UF==input$Estado)
})
}
shinyApp(ui = ui, server = server)
data <- read.csv("data.csv")
ui <- fluidPage(
selectInput("Estado",
label="Estado",
choices = c("SP","RJ"),
selected = "SP")
)
server <- function(input, output, session) {
new_data <- reactive({
data %>% filter(UF==input$Estado)
})
output$graphic <- renderPlot({
new_data() %>% ggplot() +
geom_col(aes(x=NOME_PARTIDO,y=QTDE_VOTOS))
})
}
shinyApp(ui = ui, server = server)
data <- read.csv("data.csv")
ui <- fluidPage(
selectInput("Estado",
label="Estado",
choices = c("SP","RJ"),
selected = "SP"),
plotOutput("Graph")
)
server <- function(input, output, session) {
new_data <- reactive({
data %>% filter(UF==input$Estado)
})
output$Graph <- renderPlot({
new_data() %>% ggplot() +
geom_col(aes(x=NOME_PARTIDO,y=QTDE_VOTOS))
})
}
shinyApp(ui = ui, server = server)
selectInput("Input_Nome",
label="Descricao",
choices=c("Option1","Option2"),
selected="Option1")
checkboxInput("Input_Nome",
label="Descricao",
value=FALSE)
sliderInput("Input_Nome",
label="Descricao",
min=0,
max=100,
value=0)
numericInput("Input_Nome",
label="Descricao",
min=0,
max=100,
value=0)
radioButtons("Input_Nome",
label="Descricao",
choices=c("Option1","Option2"),
selected="Option1")
checkboxGroupInput("Input_Nome",
label="Descricao",
choices=c("Option1","Option2"),
selected="Option1")
ui <- fluidPage(
titlePanel("Meu Aplicativo"),
sidebarLayout(
sidebarPanel(
selectInput("Estado",
label="Estado",
choices = c("SP","RJ"),
selected = "SP")
),
mainPanel(
plotOutput("Graph")
)
)
)
ui <- navbarPage(title = "Website",
tabPanel("tab 1", plotOutput("Chart")),
tabPanel("tab 2", tableOutput("Table")),
tabPanel("tab 3", textOutput("Text"))
)
| Criar no servidor | Colocar no UI |
|---|---|
| renderPlot({ }) | plotOutput( ) |
| renderTable({ }) | tableOutput( ) |
| renderText({ }) | textOutput( ) |