title: R Shiny: scatter plot not showing
body: <p>I am trying to render a plot_ly scatter plot based on a dynamic slidebar. However, it seems like I am missing something. </p>
  
  <p>When I run the app, the error I see is the following: </p>
  
  <blockquote>
    <p>Error: invalid first argument</p>
  </blockquote>
  
  <p>I would really appreciate your help in understanding what is going wrong. </p>
  
  <p>Please find below the code (hope it's reproducible enough now). </p>
  
  <pre><code>#load libraries to be used. Pacman ensures library reproducibility 
  if (!require("pacman")) install.package("pacman")
  pacman::p_load(ggplot2,dplyr,tidyr, rpart, shiny, shinydashboard, plotly, DT)
  
  
  #load Titanic dataset 
  dataset&lt;-read.csv(".../titanic.csv")
  
  
  ui &lt;- fluidPage(
    dashboardHeader(
      title = "My trial",
      titleWidth = 300
    ),
  
    dashboardSidebar(
      sidebarMenu(
        sidebarMenu(
          menuItem("Visualization", tabName = "visualization", icon = icon("dashboard")),
          menuItem("Data Table", tabName = "datatable", icon = icon("th"))
        )
  
      )
    ),
  
    dashboardBody(
      tabItems(
        # Content of first tab
        tabItem(tabName = "visualization",
                h2("Visualization using Plot_ly"),
                fluidRow(
                  box(plotlyOutput("Trialplot")),
                  box(
                    title = "Age range",
                    status="primary",
                    solidHeader=TRUE,
                    collapsible=TRUE,
                    sliderInput("slider", "Please select the age range to be seen:", 0, max(dataset$Age), c(0,max(dataset$Age)/2), ticks=FALSE)
                  )
                ), 
                box(plotlyOutput("Trialplot"))
  
        ),
  
        # Content of second tab
        tabItem(tabName = "datatable",
                h2("Data table")
        )
      )
    )
  )
  
  
  server = shinyServer(function(input, output,session) { 
  
  
  
    output$Trialplot&lt;-renderPlotly({
      dataset_filtered&lt;-dataset[dataset$Age ==input$slider,]
      plot_ly(data = dataset_filtered, x = ~Fare, y = ~get(input$slider) , 
                                    color=~Survived, 
                                    colors=pal, 
                                    type='scatter',
                                    marker=list(size=10),
                                    hoverinfo='text',
                                    text=~paste("Name:",Name,", Age:",Age,", Fare",Fare)
                                    )%&gt;%
                                    layout(title="Age vs.Fare")})
  
  }
  )
  
  shinyApp(ui,server)
  </code></pre>
  
  <p>Thanks in advance.</p>