I am not sure what you are after but I think this should give you a good start.
#-server.R
smpl<-read.csv("smpl.csv")
shinyServer(function(input, output) {
output$smplTab<-renderDataTable({
smpl[c(input$cname1, input$cname2)]
}, options = list(aLengthMenu = c(5, 30, 50), iDisplayLength = 5))
output$myplot<-renderPlot({
plot(smpl[c(input$cname1, input$cname2)])
})
})
#-ui.R
shinyUI(fluidPage(
titlePanel("Road Accident Analysis")
,sidebarPanel(
selectInput(inputId="cname1",choices=names(smpl),label="Variable1")
,selectInput(inputId="cname2",choices=names(smpl),label="Variable2")
)
,mainPanel(
dataTableOutput("smplTab")
,plotOutput("myplot")
)
)
)