title: How to multiply a sliderinput with a selectinput where result is shown as a text output
body: <p>New to using shinyapp and new to asking for help. 
  Here is a sample of the df called Data1:</p>
  
  <pre><code>+--------+-------+-----+-------+--------+-------------+
  |  Manu  | Model | Des | Trans |  Fuel  | costpermile |
  +--------+-------+-----+-------+--------+-------------+
  | ABARTH |     1 | a   | SAT5  | Diesel | 0.12        |
  | ABARTH |     2 | b   | 6AT   | Petrol | 0.14        |
  | ALFA   |     3 | c   | M6    | Petrol | 0.13        |
  | ALFA   |     4 | d   | M6    | Petrol | 0.11        |
  +--------+-------+-----+-------+--------+-------------+
  </code></pre>
  
  <p>I am trying to create an R shiny app where the columns are selectinputs. The user then uses a sliderinput to choose how many miles they want. I would like a  result to show [costpermile] * [sliderinput value] as a text output. </p>
  
  <p>So far my code gives the values for all the rows which isn't what i need. I dont know how to go about just getting the one value. </p>
  
  <p>Example scenario: 
  Person chooses from drop down menus:  ABARTH, 1, a, SAT5,  Diesel, 0.12
  Then chooses 100 miles in the slider
  result I would like to appear: (0.12*100) = 12</p>
  
  <pre><code>Code so far: 
  
      library(openxlsx)
      library(googlesheets4)
      library(tidyverse)
      library(tidyr)
      library(plyr)
      library(dplyr)
      library(googledrive)
      library(googlesheets)
      library(shiny)
  
      ui &lt;- fluidPage(
        selectInput("Select1", "Manu", unique(Data1$Manu)),
        selectInput("Select2", "Model", choices = NULL),
        selectInput("Select3", "Des", choices= NULL),
        selectInput("Select4", "Trans", choices= NULL),
        selectInput("Select5", "Feul", choices= NULL),
        selectInput("Select6", "costpermile", choices= NULL),
        sliderInput("num", "Choose miles", value = 100, min = 0, max = 200, step= 50),
        textOutput( "total")
  
      )
  
      server &lt;- function(input, output,session) {
        observeEvent(input$Select1,{
          updateSelectInput(session,'Select2',
                            choices=unique(Data1$Model[Data1$Manu==input$Select1]))
      }) 
  
      observeEvent(input$Select2,{
        updateSelectInput(session,'Select3',
                          choices=unique(Data1$Des[Data1$Manu==input$Select1 &amp; 
                                                             Data1$Model==input$Select2]))
      }) 
  
      observeEvent(input$Select3,{
        updateSelectInput(session,'Select4',
                          choices=unique(Data1$Trans[Data1$Manu==input$Select1 &amp; 
                                                              Data1$Model==input$Select2 &amp; 
                                                              Data1$Des==input$Select3]))
      }) 
  
      observeEvent(input$Select4,{
        updateSelectInput(session,'Select5',
                          choices=unique(Data1$Fuel[Data1$Manu==input$Select1 &amp; 
                                                             Data1$Model==input$Select2 &amp; 
                                                             Data1$Des==input$Select3 &amp; 
                                                             Data1$Trans==input$Select4]))
      }) 
  
      observeEvent(input$Select5,{
        updateSelectInput(session,'Select6',
                          choices=unique(Data1$costpermile[Data1$Manu==input$Select1 &amp;
                                                             Data1$Model==input$Select2 &amp;
                                                             Data1$Des==input$Select3 &amp;
                                                             Data1$Trans==input$Select4 &amp;
                                                             Data1$Fuel == input$Select5
                                                             ]))
      }) 
  
  
      output$out &lt;- renderUI({
        if (input$Select6 == TRUE){
        sliderInput("num", "Choose miles", value = 100, min = 0, max = 200, step= 50)
      }})
  
  
      values &lt;- reactiveValues()
  
      observe({values$complete &lt;- Data1$costpermile * input$num
  
      })
  
      output$total &lt;- renderText({ values$complete})
  
      }
  
      shinyApp( ui= ui, server= server)
  </code></pre>