I would like my shiny app to take the user's selected variables from my data set (called "CD" in this case) and I would like it to print two things: the correlation and a scatterplot.
to start, here's a head of the data:
wins kills kdRatio killstreak losses headshots misses scorePerMinute
<dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 0 0 0 0 0 0 0 0
2 0 0 0 0 0 0 0 0
3 0 66 1.03 0 0 16 0 0
4 3 2 0.4 0 0 0 0 0
5 0 2 0.2 0 0 1 0 0
6 684 27011 1.07 18 10 5113 305319 256.
the variables are named "variables:
variables = names(CD)
this is the progress I have on the ui side of things (for this tab at least):
tabPanel("Correlation Metrics",
headerPanel("Correlations Between Different COD Stats"),
mainPanel(
"Now I would like to show some correlation metrics to give a better understanding of which Call of Duty
stats really correlate with others. Please select the variables that you are interested and observe
which CoD stats correlate!",
selectInput('var1', "First Variable", variables),
selectInput('var2', "Second Variable", variables, selected = variables[[2]]),
plotOutput('correlation')
)
and this is the progress I have on the server side for this tab:
output$correlation<- renderPlot({
x<-as.numeric('var1')
y<-as.numeric('var2')
plot(x, y)
})
I know I am way off, but please help me fix this!
