ABC R Programming Data Visualisation Challenge Worksheet
title: “ISTA 320 Data Visualization Challenge 4” author: “ENTER YOUR NAME HERE” date: “Fall 2021″output: html_document
“`{r setup, include=FALSE} library(knitr) opts_chunk$set(echo = TRUE)
For this data viz challenge, you will be working with the same dataset as the [Line Plots Case Study — 2016 Advanced Placement Classes Part
# Data Wrangling Part 1
In the next code block, make sure you:
1. load the `tidyverse` library
1. read “data/exams.csv” in using `read_csv()`
1. inspect data to get an idea of what it looks like
“`{r}
# ENTER YOUR CODE HERE
Data Visualization 1
Question 1: How many students, from All Students (2016) (i.e., from all the students that took AP exams in 2016), got each score (from 1 to 5) across
different exam subjects.
1. start with the object you created when you read_csv()
2. filter out Scores that are “All” and “Average” (keep scores that are from 1 to 5)
3. start a ggplot with the following in mind: score is your sequential variable, All Students (2016) is your numeric variable (with student counts), and Exam
Subject is your categorical variable.
4. use geom_line to draw a line plot
5. make any other adjustments to make your plot clearer (e.g., use facet_wrap , change scales, add a caption)
“`{r fig.height=20}
ENTER YOUR CODE HERE
# Data Wrangling Part 2
> Question 2: What is the distribution of Average scores across exam subjects and gender (male vs. female)?
First, create a new dataframe with exam subject and average scores for male and female students.
First you need to filter your original data to keep Score that is equal to “Average” only — when you do, you are keeping rows that diplay av
Then use `select()` to keep the following columns:
– `Exam Subject`
– `Students (Male)`
– `Students (Female)`
“`{r}
# create a new data frame that holds the results of:
# start with the original data you read through read_csv and then
# filter the data to keep only Score that is equal to “Average” and then
# select Exam Subject, Students (Male), and Students (Female)
# (remember to use back tick for column names inside select())
# inspect your data to makes sure it looks good
Create a pivoted dataframe, starting with the selected dataframe you just created, and pivot_longer() the columns “Students (Male)” and “Students (Female)”.
Make any changes to the new gender column (e.g., clean it up so it only says “male” or “female”).
“`{r}
ENTER YOUR CODE HERE
You should now have a tidy dataframe with the following three variables: exam subject, gender, and average score.
# Data Visualization 2
To answer question 2, plot a line plot of “Average” scores by student count, across gender:
1. start with the tidy dataframe you created in the previous section
1. start a ggplot with the following in mind: gender is your “sequential” variable, your average score is your numeric variable, and `Exam Su
1. use `geom_line` to draw a line plot
1. use `facet_wrap` to split your plot in subplots by `Exam Subject`
1. make any other adjustments to make your plot clearer (e.g., add a caption, change number of columns in your facet_wrap, add geom_label)
“`{r fig.height=30}
# ENTER YOUR CODE HERE
Top-quality papers guaranteed
100% original papers
We sell only unique pieces of writing completed according to your demands.
Confidential service
We use security encryption to keep your personal data protected.
Money-back guarantee
We can give your money back if something goes wrong with your order.
Enjoy the free features we offer to everyone
-
Title page
Get a free title page formatted according to the specifics of your particular style.
-
Custom formatting
Request us to use APA, MLA, Harvard, Chicago, or any other style for your essay.
-
Bibliography page
Don’t pay extra for a list of references that perfectly fits your academic needs.
-
24/7 support assistance
Ask us a question anytime you need to—we don’t charge extra for supporting you!
Calculate how much your essay costs
What we are popular for
- English 101
- History
- Business Studies
- Management
- Literature
- Composition
- Psychology
- Philosophy
- Marketing
- Economics