In this exercise you will look at a dataset called cereal.csv. This dataset contains nutrition data on different types of cereal. But instead of just running command and answering questions, you will complete this markdown document. For more details on using R Markdown see http://rmarkdown.rstudio.com.
- Anything you type here will be shown in th eoutput file.
- You can click the Knit button to see a preview of you document.
- You can embed an R code chunk between
'''{r} and ''' (you can use command + option + i to insert these two).
The dataset is has the following variables:
- Name: Name of cereal
- mfr: Manufacturer of cereal
- A = American Home Food Products;
- type:
- calories: calories per serving
- protein: grams of protein
- fat: grams of fat
- sodium: milligrams of sodium
- fiber: grams of dietary fiber
- carbo: grams of complex carbohydrates
- sugars: grams of sugars
- potass: milligrams of potassium
- vitamins: vitamins and minerals - 0, 25, or 100, indicating the typical percentage of FDA recommended
- shelf: display shelf (1, 2, or 3, counting from the floor)
- weight: weight in ounces of one serving
- cups: number of cups in one serving
- rating: a rating of the cereals (Possibly from Consumer Reports?)
These datasets have been gathered and cleaned up by Petra Isenberg, Pierre Dragicevic and Yvonne Jansen. The original source can be found here: https://perso.telecom-paristech.fr/eagan/class/igr204/datasets
So letโs get started. First, read the dataset. Type in the cmmand to read the dataset below.
Now go through the list of questions below and answer them one by one. You need to type in the command, run it, and type your answer after the code. You can run your code in this window using the play sign.
- How many cereals are there?
Answer:
- How many variables do we have about each cereal?
Answer:
- How many hot cereals are there?
Answer:
- Which manufacturer has the fewest number of cereals in this dataset?
Answer:
- What is the average amount of suger in cereals?
Answer:
- What is the average amount of fat in cereals?
Answer:
- What is the average amount of fat in cereals?
Answer:
- What is highes ranked cereal?
Answer:
- Which manufacturer makes has the highest ranked cereals?
Answer:
- What is the most common percentage of vitamins?
Answer:
- On which fator are cereals likely to vary? fat or sugar?
Answer: