DDP_Project

Jackie Goor
05/04/2016

Developing Data Products: Using ChickWeight Data to Demonstrate a shinyapp

Purpose:

This presentation was created using RStudio Presenter. It was created to demonstrate the use of:

  • RStudio Presenter
  • shiny

The shiny application that was created will present the ChickWeight data (from the “ggplot2” package) and allow the user to select to view the data for each diet.

The Data:

The ChickWeight data set contains 578 observations of 4 variables: - weight = weight of chick in grams - Time = number of days since birth until weight was taken - Chick = unique identifier for the chick - Diet = identifier for which diet the chick received (1 thru 4)

In addition the average weight for the chicks for each diet and for each number of days after birth was calculated. The application allows the user to select a diet (1 thru 4). It will show the detailed data points for that diet plus line for the average weight for all the chicks on that diet for the number of days after birth.

The application can be found at:

Shiny Application

A plot showing the average lines for each diet is created below.

ggplot() + geom_line(data=Diets, aes(y=AvgWeight, x=Time, color=Diet, group=Diet)) + 
xlab("Number pf Days Since Birth") +
ylab("Average Chick Weight in Grams") +
ggtitle("Chick Weight by Time and Diet")

plot of chunk unnamed-chunk-2

##summary(fit)
##predict(fit)

Conclusion:

    The ChickWeight data shows that Diet #3 showed the most growth for the chicks, followed by diets 4, 2, and finally Diet #1. Although the data presented was trivial, it was useful to go through the entire process of creating a shiny application and presenting it.