Question
Need help with an assignment in R # Use the nycflights13 package and the flights data frame to answer the following questions: to get the
Need help with an assignment in R
# Use the nycflights13 package and the flights data frame to answer the following questions:
to get the package install the mdsr and nycflights13 packages into r with the following code:
install.packages("mdsr")
install.packages("nycflights13")
**Q1) What month had the highest proportion of cancelled flights? What month had the lowest? Interpret any seasonal patterns**
**Q2) What plane (specified by the tailnum variable) traveled the most times from New York City airports in 2013? Plot the number of trips per week over the year. **
**Q3) Using the planes dataframe inside nycflights13, find the oldest plane that flew from New York City airports. How many airplanes that flew from New York City are included in the planes table? **
**Q4) Use the weather table from the nycflights13 package to answer the following question: On how many days was there precipitation in the New York area in 2013? Were there differences in the mean visibility based on the day of the week and / or month of the year? **
# Install the Lahman package to answer the following questions
**Q5) Define two new variables in the Teams data frame from the Lahman package: batting average and slugging percentage. Batting average is the ratio of hits (H) to at-bats (AB), and slugging percentage is total bases divided by at-bats. To compute total bases, you get 1 for a single, 2 for a double, 3 for atriple, and 4 for a home run. **
**Q6) Display the top 15 teams ranked in terms of slugging percentage in MLB history.Repeat using teams since 1969 **
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started