non-numeric argument to binary operator r shiny

library(shiny)
library(tidyverse)
library(babynames)

ui = fluidPage(textInput(inputId = "name",
label = "Name:",
value = "",
placeholder = "MaheshGuru"),
selectInput(inputId = "sex",
label = "Sex:",
choices = list(Female = "F", Male = "M")),
sliderInput(inputId = "year",
label = "Year Range :",
min = min(babynames$year),
max = max(babynames$year),
value = c(min(babynames$year),max(babynames$year)),
sep = ""),
plotOutput(outputId = "nameplot")
)
server = function(input,output) {
output$nameplot = renderPlot(
babynames %>%
filter( sex == input$sex,
name == input$name) %>%
ggplot(aes(x = year,
y = n)) +
geom_line() +
scale_x_continuous(limits = input$year),
theme_minimal()
)

}
shinyApp(ui = ui, server = server)

Getting an error while running the app

Error : non-numeric argument to binary operator

scale_x_continuous(limits = input$year) +
theme_minimal()

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.