How to convert selectInput choice into a variable name?

Sample code:

selectInput(inputId = "sampleDataset",
                    label = "Choose Dataset",
                    choices =  c('boston', 'auto_mpg', 'red_wine'),
                    selected = "boston")

 data_preloaded <- reactive({

 var_name <- data_preloaded()  #> not working

im confused about your intentions.
to choose datasets or variables form within a dataset?

also if var_name <- data_preloaded()
is just a one liner in your server code, then it would only execute once, and not be reactive, what is the intention ?