Innuganti
10/9/2018
For the Developing Data Products Course Shiny App Project, I have developed a Shiny Application for use with the trees dataset package in R. This data set provides measurements of the girth, height and volume of timber in 31 felled black cherry trees. Note that girth is the diameter of the tree (in inches) measured at 4 ft 6 in above the ground.
A data frame with 31 observations on 3 variables.
Shiny application allows the user to choose a Girth value from the scale, and the application will reactively displays the volume of the based on the Girth Value.
library(shiny)
library(rsconnect)
server <- function(input, output) {
output$distPlot <- renderPlot({
x <- trees$Volume
Girth <- seq(min(x), max(x), length.out = input$Girth + 1)
hist(x, breaks = Girth, col = 'brown', border = "white",
xlab = "Volume of the tree based on Girth ",
main = "Histogram of the Volume of the Black Cherry Tree")
})
}
library(shiny)
ui <- fluidPage(
# App title
titlePanel("Determine the Volume of the Tree based on Girth"),
# Sidebar layout with input and output definitions
sidebarLayout(
# Sidebar panel for inputs
sidebarPanel(
# Input: Slider for the number of bins
sliderInput(inputId = "Girth",
label = "Slide the Girth value:",
min = 8,
max = 20.6,
value = 10)),
# Main panel for displaying outputs
mainPanel(
# Output: Histogram
plotOutput(outputId = "distPlot")
)
)
)
To run Shiny App please click the Link below :
https://innugantii.shinyapps.io/Trees/
To see detailed code follow the Github link :