Overview

This file contains a set of tasks that you need to complete in R for the lab assignment. The tasks may require you to add a code chuck, type code into a chunk, and/or execute code. Don’t forget that you need to acknowledge if you used any resources beyond class materials or got help to complete the assignment.

Additional information, include examples and code, about this assignment can be found in the file “VisualizingDistributionsTutorial.html”.

The data set you will use is different than the one used in the instructions. Pay attention to the differences in the Excel files’ names, any variable names, or object names. You will need to adjust your code accordingly.

Once you have completed the assignment, you will need to knit this R Markdown file to produce an .html file. You will then need to upload the .html file and this .Rmd file to AsULearn.

1. Add your Name and the Date

The first thing you need to do in this file is to add your name and date in the lines underneath this document’s title (see the code in lines 9 and 10).

2. Identify and Set Your Working Directory

You need to identify and set your working directory in this section. If you are working in the cloud version of RStudio, enter a note here to tell us that you did not need to change the working directory because you are working in the cloud. >setwd(“/Users/corddoss/Desktop/Research methods class/Week 8/8 Assignment Visualizing Distributions”)

3. Installing and Loading Packages and Data Set

You load the packages and data set you’ll use for the lab assignment in this section. In this lab we will use the packages: dplyr, tidyverse, forcats, ggplot2, and openxlsx. > library(“dplyr”) > library(“tidyverse”) > library(“openxlsx”) > library(“forcats”) > library(“ggplot2”) > VisualizingVariablesData <- read.xlsx(“VisualizingVariablesData.xlsx”) # 4. Histogram of Price for Plate of Ribs Create a histogram showing the distribution of the variable measuring the price someone would pay for a plate of ribs.
ggplot(VisualizingVariablesData, #data argument aes(x=Dinner.Plate.Price)) + #mapping and aesthetics arguments geom_histogram() #geom argument - Change the labels on the x- and y- axes to words instead of using the variable name. Make sure that the labels on both the x- and y-axes are capitalized. ggplot(VisualizingVariablesData, aes(x=Dinner.Plate.Price)) +
geom_histogram(fill=“red”) +
labs(x=“Dinner Plate Price”, y=“Count”)

5. Histogram of Minutes Driving

Create a histogram showing the distribution of the variable measuring the minutes someone is willing to drive for BBQ. ggplot(VisualizingVariablesData, #data argument aes(x=driving)) + #mapping and aesthetics arguments geom_histogram() #geom argument - Change the labels on the x- and y-axes to words instead of using the variable name. Make sure that the labels on both the x- and y-axes are capitalized.

6. Density Plot of Minutes Driving

Create a density plot showing the distribution of the variable measuring minutes someone is willing to drive for BBQ.

7. Density Plot of Price for Pulled Pork Sandwich

Create a density plot showing the distribution of the variable measuring the price someone is willing to pay for a pulled pork sandwich.

8. Box-and-Whisker Plot of Pulled Pork Sandwich

Create a box-and-whisker plot of the variable measuring the price someone is willing to pay for a pulled pork sandwich.

9. Box-and-Wisker Plot of Minutes Willing to Drive

Create a box-and-whisker plot of the variable measuring the minutes someone is willing to drive for BBQ.

10. Did you receive help?

Enter the names of anyone one that assisted you with completing this lab. If no one helped you complete the assignment, just type out that no one helped you

11. Did you provide anyone help with completing this lab?

Enter the names of anyone that you assisted with completing this lab. If you did not help anyone, then just type out that you didn’t help anyone.

12. Publish Document

Click the “Knit” button to publish your work as an html document. This document or file will appear in your working directory. You will need to upload both this RMarkdown file and the html file it produces to AsU Learn to get all of the lab points for this week.