I have a regression plot in a shiny dashboard tab item
here's the code for that
tabItem(tabName = "regressionanalysis", h2("Regression Analysis"),
# Begin first fluid row
fluidRow(
# Begin first box plot
box(width = 12,
column(6,
plotOutput("plotRegression", 350),
verbatimTextOutput('regressionResults')
),
column(6,
plotOutput("histogramdbis", height = 250),
verbatimTextOutput('dbisRegHistogramDescriptives'),
plotOutput("histogramciatas", height = 250),
verbatimTextOutput('ciatasRegHistogramDescriptives')
)
)
) # End fluid row
),# End third tab item
It runs just fine when I launch the dashboard
here's the code for that
output$plotRegression <- renderPlot({
plotRegressionModel <- lm(dbis ~ ciatas, data = dbrp_data1)
summary(plotRegressionModel)
ggplot(dbrp_data1, aes(dbis, ciatas)) + geom_point() + stat_smooth(method = lm) +
labs(title = "Regression Model", x = "dbis", y = "ciatas")
})
I've built select boxes in other parts of the dashboard, but what I'm trying to accomplish now is to use a select box on the regression tab and filter the data by U.S. state.
I'm trying to find a good reference/solution for this.
Also - I'm not currently using data frames. All computation is performed on the base data set.
Cheers ~!