Pessoal, tudo bem?
Ao rodar esse script abaixo aparece o seguinte erro:
“Error in subset.data.frame(babynames, name) : ‘subset’ deve ser lógico”
Alguma dica valiosa pessoal?
Muito obrigado!
library(shiny)
library(ggplot2)
library(babynames)
ui <- fluidPage(
titlePanel(“Baby Name Explorer”),
sidebarLayout(
sidebarPanel(textInput(inputId = ‘name’, label = ‘Enter Name’, placeholder = ‘First name here’)),
mainPanel(plotOutput(‘trend’))
)
)
server <- function(input, output, session) {
output$trend <- renderPlot({
# CODE BELOW: Update to display a line plot of the input name
ggplot(subset(babynames, name)) +
geom_line(aes(x = year, y = prop, color = sex))
})
}
shinyApp(ui = ui, server = server)