0

[picture of my code and shiny app][1]I am trying to write a shiny app where I have two drop down menus and I create two histograms from those dropdowns and a salary variable I have stored in a dataframe. I can create the drop downs but I am lost on how to save the selection and use the selection as a independent variable for my model. any help at all would be huge.

I tried using a save button to save the selection from the drop down but I couldn't get that to store the variable in a way that I could verify with my dataframe.

code below

    library(dplyr)
    library(ggplot2)
    library(shiny)
    data <- read.csv("C:/Users/lewis/OneDrive/Desktop/STA 580( R 
    programming)/Final_Project/salaries_entry.csv")

       data


    wxdata <- data.frame(
       Remote = c("0%", "50%", "100%"),
       Size = c("Small","Medium","Large") 

    )


    remotelist <- unique(wxdata$Remote)
    sizelist <- unique(wxdata$Size)


    ui <- fluidPage(
    titlePanel("Data Science / Data Engineer Salaries"),

    sidebarLayout(
    sidebarPanel(),
    mainPanel(
  
         h4("The purpose of this app is to give you an idea"),
         h4("about the potential money you could be making as an"),
         h4("entry level employee in the Data Science field based "),
         h4("on a few key factors. Test it out and Get that BAG!")
       )
    ),



     inputPanel(
        selectInput(
        "RemoteWork",
            label = "Select Amount of Remote Work",
            choices = remotelist
         )

       ),
     inputPanel(
          selectInput(
            "CompanySize",
            label = "Select the Size of the Company",
            choices = sizelist
          )
       ),
    )

    server <- function(input, output) {
       output$minplot <- renderPlot(draw_plot(input$PlotCity))
     }

    shinyApp(ui = ui, server = server)
  • Welcome to StackOverflow. Please paste the actual code into your question with a sniper of the actual data to help others help you. For tips on how to ask a good question see [here](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – Dan Adams Nov 16 '22 at 03:03
  • Greetings! Usually it is helpful to provide a minimally reproducible dataset for questions here so people can troubleshoot your problems. One way of doing this is by using the `dput` function. You can find out how to use it here: https://youtu.be/3EID3P1oisg – Shawn Hemelstrand Nov 16 '22 at 06:36

0 Answers0