Research Question: What are the factors that influences ones comfortability on airplanes?

There are so many factors that play a role in a passengers comfortability on an airplane everyday. Whether people are taking a flight for business or vacation, millions of people fly everyday and have created opinions on how one should behave during a flight. Variables such as a baby crying, the middle armrest getting taken, or not having enough leg room after the person in front of you reclines their seat, have impacted the majority of passengers during a flight allowing them to relate this topic and each other. Now sit back and imagine you are going to take a flight where not everything goes as you had hoped.

Lets explore the data set

         #install.packages("fivethirtyeight")
         library(fivethirtyeight)
         glimpse(flying)
## Rows: 1,040
## Columns: 27
## $ respondent_id        <dbl> 3436139758, 3434278696, 3434275578, 3434268208, …
## $ gender               <chr> NA, "Male", "Male", "Male", "Male", "Male", "Mal…
## $ age                  <ord> NA, 30-44, 30-44, 30-44, 30-44, 30-44, 30-44, 30…
## $ height               <ord> NA, 6'3", 5'8", 5'11", 5'7", 5'9", 6'2", 6'0", 6…
## $ children_under_18    <lgl> NA, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE,…
## $ household_income     <ord> NA, NA, "$100,000 - $149,999", "$0 - $24,999", "…
## $ education            <ord> NA, Graduate degree, Bachelor degree, Bachelor d…
## $ location             <chr> NA, "Pacific", "Pacific", "Pacific", "Pacific", …
## $ frequency            <ord> Once a year or less, Once a year or less, Once a…
## $ recline_frequency    <ord> NA, About half the time, Usually, Always, About …
## $ recline_obligation   <lgl> NA, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE,…
## $ recline_rude         <ord> NA, Somewhat, No, No, No, No, Somewhat, No, No, …
## $ recline_eliminate    <lgl> NA, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRU…
## $ switch_seats_friends <ord> NA, No, No, Somewhat, No, Somewhat, Somewhat, No…
## $ switch_seats_family  <ord> NA, No, No, No, No, No, No, No, NA, Very, No, NA…
## $ wake_up_bathroom     <ord> NA, No, No, No, Somewhat, Somewhat, No, No, NA, …
## $ wake_up_walk         <ord> NA, No, Somewhat, Somewhat, Somewhat, Very, No, …
## $ baby                 <ord> NA, No, Somewhat, Somewhat, Somewhat, Very, No, …
## $ unruly_child         <ord> NA, No, Very, Very, Very, Very, Somewhat, Very, …
## $ two_arm_rests        <chr> NA, "The arm rests should be shared", "Whoever p…
## $ middle_arm_rest      <chr> NA, "The arm rests should be shared", "The arm r…
## $ shade                <chr> NA, "Everyone in the row should have some say", …
## $ unsold_seat          <ord> NA, No, No, No, No, Somewhat, No, No, No, Very, …
## $ talk_stranger        <ord> NA, No, No, No, No, No, Somewhat, No, No, Very, …
## $ get_up               <ord> NA, Twice, Three times, Three times, Twice, Once…
## $ electronics          <lgl> NA, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FAL…
## $ smoked               <lgl> NA, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FA…

About FiveThirtyEight

FiveThirtyEight is the source of this data set. This dataset was published on September 5, 2014. They have conducted a surveymonkey that contains various questions regarding one’s experience throughout a flight. They have received 1,040 responses all throughout various regions within the United States (Mountain, West South Central,South Atlantic, West North Central, New England, Pacific, Middle Atlantic, East North Central, and East South Central) which has created a dynamic set of opinions. The data is trustworthy as it has been directly gathered from the passengers that have flown on airplanes. Although the dataset is from first hand sources, some answers may have been untruthful as it could have not been filled out to the best of their ability. Andrei Scheinkman collected the original data which was then published in an article by Walt Hickey. The data is pre-processed and is accesible from the “fivethirtyeight” library.

It is also avaialble on the gihub site : https://github.com/fivethirtyeight/data/tree/master/flying-etiquette-survey This set has not been altered since 2014.

Cleaning the Data Set

flying_new <- flying %>%
        drop_na()

flying_proj <- flying_new %>%
        select(gender, age, height, household_income, education, location, frequency, recline_frequency, recline_frequency, recline_obligation, recline_rude, switch_seats_family, wake_up_bathroom, baby, unruly_child, two_arm_rests, middle_arm_rest, shade, unsold_seat, talk_stranger, get_up)

glimpse(flying_proj)
## Rows: 582
## Columns: 20
## $ gender              <chr> "Male", "Male", "Male", "Male", "Male", "Male", "…
## $ age                 <ord> 30-44, 30-44, 30-44, 30-44, 30-44, 30-44, 30-44, …
## $ height              <ord> 5'8", 5'11", 5'7", 5'9", 6'0", 5'6", 6'0", 5'8", …
## $ household_income    <ord> "$100,000 - $149,999", "$0 - $24,999", "$50,000 -…
## $ education           <ord> Bachelor degree, Bachelor degree, Bachelor degree…
## $ location            <chr> "Pacific", "Pacific", "Pacific", "East North Cent…
## $ frequency           <ord> Once a year or less, Once a year or less, Once a …
## $ recline_frequency   <ord> Usually, Always, About half the time, Usually, On…
## $ recline_obligation  <lgl> TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE…
## $ recline_rude        <ord> No, No, No, No, No, Very, No, No, Very, No, No, N…
## $ switch_seats_family <ord> No, No, No, No, No, Very, No, No, No, No, No, Som…
## $ wake_up_bathroom    <ord> No, No, Somewhat, Somewhat, No, Very, Somewhat, S…
## $ baby                <ord> Somewhat, Somewhat, Somewhat, Very, Somewhat, Ver…
## $ unruly_child        <ord> Very, Very, Very, Very, Very, Very, Very, No, No,…
## $ two_arm_rests       <chr> "Whoever puts their arm on the arm rest first", "…
## $ middle_arm_rest     <chr> "The arm rests should be shared", "The arm rests …
## $ shade               <chr> "The person in the window seat should have exclus…
## $ unsold_seat         <ord> No, No, No, Somewhat, No, Very, Very, No, No, No,…
## $ talk_stranger       <ord> No, No, No, No, No, Very, No, No, No, No, No, No,…
## $ get_up              <ord> Three times, Three times, Twice, Once, Four times…

The airport is always a busy place, lets see how often people travel…

Visualization - The frequency of travel by region in the United States

library(ggridges)
library(tidyverse)


flying_map <- flying_proj %>%
  group_by(frequency)%>%
  count(location, frequency)%>%
  mutate(p = n/sum(n), percent = round(100 * p, 2))



ggplot(flying_map) +
  geom_segment(aes(x = location,xend = location,y = 0,yend = percent, color= frequency),size=2) +
  geom_point(aes(x=location, y=percent,color= frequency), size= 2.5)+
  coord_flip()+
 theme_minimal_vgrid(
                font_family = 'Fira Sans Condensed',
                font_size = 10 ) +
  scale_y_continuous(
            limits = c(0, 100))+
  facet_wrap(~frequency, ncol=1)+
  panel_border()+
  
     labs(title = '                US travel frequency by region',
        y= " Passenger Percentage",
        x = 'US Region',
       color = 'Frequency',
      font_family = 'Fira Sans Condensed')