Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

data-viz-challenge-3-FatimahAldhamen-main/data-viz-challenge-03.Rmd --- title: "ISTA 320 Data Visualization Challenge 3" author: "ENTER YOUR NAME HERE" date: "Fall 2021" output: html_document ---...

1 answer below »
data-viz-challenge-3-FatimahAldhamen-main/data-viz-challenge-03.Rmd
---
title: "ISTA 320 Data Visualization Challenge 3"
author: "ENTER YOUR NAME HERE"
date: "Fall 2021"
output: html_document
---
```{r setup, include=FALSE}
li
ary(knitr)
li
ary(tidyverse)
opts_chunk$set(echo = TRUE)
```
We will be working with the same flight data that I created the tutorials and demonstration video for this module. We will be working with data from 2009 and 2018.
# Read data in
There are two data files (`csv` format) inside the data folder in this project. Read both files (using `read_csv()`), and combine them into one data frame (using `bind_rows()`). Mutate the year variable so it is a factor (and not a numerical variable).
```{r}
# read data in
flight_delays_data_2009 <- ______________
flight_delays_data_2018 <- ______________
# combine data
flight_delay_data_2009_2018 <- bind_rows(______________)
# inspect data
glimpse(______________)
# mutate year so year is a facto
flight_delay_data_2009_2018 <- flight_delay_data_2009_2018 %>%
mutate(______________)
```
# Scatterplots
QUESTION 1: What's the relationship between mean a
ival delay time and mean departure delay time? These two variables are in minutes.
QUESTION 2: Is this relationship similar across the two years in the data?
To answer these two questions, draw a scatterplot mapping the numerical variables to the axes and the categorical variable to color.
```{r}
flight_delay_data_2009_2018 %>%
ggplot(______________) +
______________
```
TYPE YOUR ANSWER TO THE TWO QUESTIONS ABOVE (i.e., your interpretation of the scatterplot you produced) HERE -- REPLACE THIS TEXT WITH YOUR ANSWER
For the second part of this data viz challenge, you will be working with the same netflix data from [D2L's Barplots Case Study 1 - Netflix Movies and TV Shows](https:
d2l.arizona.edu/d2l/le/content/1064958/viewContent/ XXXXXXXXXX/View).
# Read and inspect the data
The data file (in csv format) is inside the `data` folder in this project. Read and inspect the data.
```{r}
```
# Bar plots
Question 1: What is the two most common ratings (i.e., `rating` variable) for the movies and TV shows in this dataset?
Suggestions on how to answer this question:
1. draw a barplot (using `geom_bar`) mapping `x` to `rating`. Add another categorical variable to the plot, mapping `fill` to `type`.
2. draw a barplot (using `geom_col`) mapping `x` to `rating`. Add another categorical variable to the plot, mapping `fill` to `type`. Reorder the ratings using `reorder()`
I will consider this item done if you draw any of the two (or alternative both) barplots suggested above.
```{r}
```
TYPE YOUR ANSWER TO THE FIRST QUESTION (i.e., your interpretation of the barplot you produced) HERE -- REPLACE THIS TEXT WITH YOUR ANSWER
Question 2: What is the most common duration (in seasons) for TV shows?
Suggestion of steps for how to answer this question:
1. Filter the data to keep only `TV Show` for `type`.
2. Draw a barplot (using `geom_bar`) mapping `duration` to one of the axes (either `y` or `x`, whatever you find easier to visualize).
3. Ensure the bars are ordered in a way that makes sense for the `duration` variable (ascending or descending order, from left to right, your choice here)
I will consider this item done if implement all three items above.
```{r}
```
TYPE YOUR ANSWER TO THE SECOND QUESTION (i.e., your interpretation of the barplot you produced) HERE -- REPLACE THIS TEXT WITH YOUR ANSWER
Question 3: What is the average duration in minutes of movies across different ratings in the data set.
1. Filter the data to keep only `Movie` for `type`.
1. Mutate duration so it is a number (this step is done for you in the R chunk below)
1. Summarize `mean_duration` by `rating`
1. Draw a barplot (using `geom_col`) `mean_duration` to `y` and `rating` to `x`
1. Order the ratings so that they are in an order that makes it easier to read the plot (hint: not the default alphabetical order)
I will consider this item done if implement all items above.
```{r}
netflix_movie_data <- REPLACE_THIS_WITH_YOUR_DATAFRAME_OBJECT_NAME %>%
filter(_____________) %>%
mutate(duration = parse_number(duration)) # no need to change this line
netflix_movie_data %>%
group_by(_____________) %>%
summarize(mean_duration = _____________) %>%
ggplot(_____________) +
_____________
```
data-viz-challenge-3-FatimahAldhamen-main/data/2009.csv
airline,mean_a
ival_delay,mean_departure_delay,mean_distance,yea
9E, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2009
AA, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2009
AS, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2009
B6, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2009
CO, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2009
DL, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2009
EV, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2009
F9, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2009
FL, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2009
HA, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2009
MQ, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2009
NW, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2009
OH, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2009
OO, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2009
UA, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2009
US, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2009
WN, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2009
XE, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2009
YV, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2009
data-viz-challenge-3-FatimahAldhamen-main/data/2018.csv
airline,mean_a
ival_delay,mean_departure_delay,mean_distance,yea
9E, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2018
AA, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2018
AS, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2018
B6, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2018
DL, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2018
EV, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2018
F9, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2018
G4, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2018
HA, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2018
MQ, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2018
NK, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2018
OH, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2018
OO, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2018
UA, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2018
VX, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2018
WN, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2018
YV, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2018
YX, XXXXXXXXXX, XXXXXXXXXX, XXXXXXXXXX,2018
data-viz-challenge-3-FatimahAldhamen-main/data/netflix_titles.csv
show_id,type,title,director,cast,country,date_added,release_year,rating,duration,listed_in,description
s1,TV Show,3%,,"João Miguel, Bianca Comparato, Michel Gomes, Rodolfo Valente, Vaneza Oliveira, Rafael Lozano, Viviane Porto, Mel Fronckowiak, Sergio Mamberti, Zezé Motta, Celso Frateschi",Brazil,"August 14, 2020",2020,TV-MA,4 Seasons,"International TV Shows, TV Dramas, TV Sci-Fi & Fantasy","In a future where the elite inhabit an island paradise far from the crowded slums, you get one chance to join the 3% saved from squalor."
s2,Movie,7:19,Jorge Michel Grau,"Demián Bichir, Héctor Bonilla, Oscar Se
ano, Azalia Ortiz, Octavio Michel, Carmen Beato",Mexico,"December 23, 2016",2016,TV-MA,93 min,"Dramas, International Movies","After a devastating earthquake hits Mexico City, trapped survivors from all walks of life wait to be rescued while trying desperately to stay alive."
s3,Movie,23:59,Gilbert Chan,"Tedd Chan, Stella Chung, Henley Hii, Lawrence Koh, Tommy Kuan, Josh Lai, Mark Lee, Susan Leong, Benjamin Lim",Singapore,"December 20, 2018",2011,R,78 min,"Ho
or Movies, International Movies","When an army recruit is found dead, his fellow soldiers are forced to confront a te
ifying secret that's haunting their jungle island training camp."
s4,Movie,9,Shane Acker,"Elijah Wood, John C. Reilly, Jennifer Connelly, Christopher Plummer, Crispin Glover, Martin Landau, Fred Tatasciore, Alan Oppenheimer, Tom Kane",United States,"November 16, 2017",2009,PG-13,80 min,"Action & Adventure, Independent Movies, Sci-Fi & Fantasy","In a postapocalyptic world, rag-doll robots hide in fear from dangerous machines out to exterminate them, until a
ave newcomer joins the group."
s5,Movie,21,Robert Luketic,"Jim Sturgess, Kevin Spacey, Kate Bosworth, Aaron Yoo, Liza Lapira, Jacob Pitts, Laurence Fishburne, Jack McGee, Josh Gad, Sam Golzari, Helen Carey, Jack Gilpin",United States,"January 1, 2020",2008,PG-13,123 min,Dramas,A
illiant group of students become card-counting experts with the intent of swindling millions out of Las Vegas casinos by playing blackjack.
s6,TV Show,46,Serdar Akar,"Erdal Beşikçioğlu, Yasemin Allen, Melis Birkan, Saygın Soysal, Berkan Şal, Metin Belgin, Ayça Eren, Selin Uludoğan, Özay Fecht, Suna Yıldızoğlu",Turkey,"July 1, 2017",2016,TV-MA,1 Season,"International TV Shows, TV Dramas, TV Mysteries","A genetics professor experiments with a treatment for his comatose sister that blends medical and shamanic cures, but unlocks a shocking side effect."
s7,Movie,122,Yasir Al Yasiri,"Amina Khalil, Ahmed Dawood, Tarek Lotfy, Ahmed El Fishawy, Mahmoud Hijazi, Jihane Khalil, Asmaa Galal, Tara Emad",Egypt,"June 1, 2020",2019,TV-MA,95 min,"Ho
or Movies, International Movies","After an awful accident, a couple admitted to a grisly hospital are separated and must find each other to escape — before death finds them."
s8,Movie,187,Kevin Reynolds,"Samuel L. Jackson, John Heard, Kelly Rowan, Clifton Collins Jr., Tony Plana",United States,"November 1, 2019",1997,R,119 min,Dramas,"After one of his high school students attacks him, dedicated teacher Trevor Garfield grows weary of the gang warfare in the New York City school system and moves to California to teach there, thinking it must be a less hostile environment."
s9,Movie,706,Shravan Kumar,"Divya Dutta, Atul Kulkarni, Mohan Agashe, Anupam Shyam, Raayo S. Bakhirta, Yashvit Sancheti, Greeva Kansara, Archan Trivedi, Rajiv Pathak",India,"April 1, 2019",2019,TV-14,118 min,"Ho
or Movies, International Movies","When a doctor goes missing, his psychiatrist wife treats the biza
e medical condition of a psychic patient, who knows much more than he's leading on."
s10,Movie,1920,Vikram Bhatt,"Rajneesh Duggal, Adah Sharma, Indraneil Sengupta, Anjori Alagh, Rajendranath Zutshi, Vipin Sharma, Amin Hajee, Shri Vallabh Vyas",India,"December 15, 2017",2008,TV-MA,143 min,"Ho
or Movies, International Movies, Thrillers",An architect and his wife move into a castle that is slated to become a luxury hotel. But something inside is determined to stop the renovation.
s11,Movie,1922,Zak Hilditch,"Thomas Jane, Molly Parker, Dylan Schmid, Kaitlyn Bernard, Bob Frazer, Brian d'Arcy James, Neal McDonough",United States,"October 20, 2017",2017,TV-MA,103 min,"Dramas, Thrillers","A farmer pens a confession admitting to his wife's murder, but her death is just the beginning of a maca
e tale. Based on Stephen King's novella."
s12,TV Show,1983,,"Robert Więckiewicz, Maciej Musiał, Michalina Olszańska, Andrzej Chyra, Clive Russell, Zofia Wichłacz, Edyta Olszówka, Mateusz Kościukiewicz, Ewa Błaszczyk, Vu Le Hong, Tomasz Włosok, Krzysztof Wach","Poland, United States","November 30, 2018",2018,TV-MA,1 Season,"Crime TV Shows, International TV Shows, TV Dramas","In this dark alt-history thriller, a naïve law student and a world-weary detective uncover a conspiracy that has tyrannized Poland for decades."
s13,TV Show,1994,Diego Enrique Osorno,,Mexico,"May 17, 2019",2019,TV-MA,1 Season,"Crime TV Shows, Docuseries, International TV Shows","Archival video and new interviews examine Mexican politics in 1994
Answered 1 days After Sep 10, 2021

Solution

Charulata Anil answered on Sep 10 2021
141 Votes
li
ary(knitr)
li
ary(tidyverse)
li
ary(readr)
flight_delays_data_2009 <- read_csv("data/2009.csv")
flight_delays_data_2009
li
ary(readr)
flight_delays_data_2018 <- read_csv("data/2018.csv")
flight_delays_data_2018
flight_delay_data_2009_2018 <- bind_rows(flight_delays_data_2009,flight_delays_data_2018)
flight_delay_data_2009_2018
glimpse(flight_delay_data_2009_2018)
flight_delay_data_2009_2018 <- flight_delay_data_2009_2018 %>%
mutate( flight_delay_data_2009_2018,year=as.factor(year))
flight_delay_data_2009_2018
flight_delay_data_2009_2018 %>%
ggplot(aes(mean_a
ival_delay,mean_departure_delay,colour=airline)) +
geom_point(size=3,alpha=0.5)+
labs(title = "Scatterplot")
# QUESTION 1: What's the relationship between mean a
ival delay time and mean departure delay time? These two variables are in minutes.
#Ans: There is...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here