Question

2. Use R software flight data, follow below to install, then answer questions a library(dplyr) install.packages(nycflights13) library(nycflights13) a. Find the top 3 destinations (dest) for each origin (origin).

0 0
Add a comment Improve this question Transcribed image text
Answer #1

library(dplyr)
library(nycflights13)
data("flights")
flights

flights %>% group_by(origin,dest) %>% summarize(count=n()) %>% top_n(3)
  

the results are

flights %>% group_by(origin,dest) %>% summarize(count=n()) %>% top_n(3)
Selecting by count
# A tibble: 9 x 3
# Groups: origin [3]
origin dest count
<chr> <chr> <int>
1 EWR BOS 5327
2 EWR ORD 6100
3 EWR SFO 5127
4 JFK BOS 5898
5 JFK LAX 11262
6 JFK SFO 8204
7 LGA ATL 10263
8 LGA CLT 6168
9 LGA ORD 8857

Add a comment
Know the answer?
Add Answer to:
2. Use R software flight data, follow below to install, then answer questions a library(dplyr) install.packages("nycflights13")...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • For this exercise, you will need to use the packages `mosaic` and `dplyr`. ```{r warning=FALSE, message=FALSE}...

    For this exercise, you will need to use the packages `mosaic` and `dplyr`. ```{r warning=FALSE, message=FALSE} # install packages if necessary if (!require(mosaic)) install.packages(`mosaic`) if (!require(dplyr)) install.packages(`dplyr`) # load the package in R library(mosaic) # load the package mosaic to use its functions library(dplyr) # load the package dplyr to use data management functions ``` 1. For decades it's been suspected that schizophrenia involves anatomical abnormalities in the hippocampus, an area of the brain involved with memory. The following data...

  • Data manipulation using R Download and load Most_popular_baby_name.csv to R using the following R code: library('tidyverse')...

    Data manipulation using R Download and load Most_popular_baby_name.csv to R using the following R code: library('tidyverse') baby_names <- read_csv("http://personal.stevens.edu/~fmai/data/Most_Popular_Baby_Names.csv") The file contains the counts of baby names by sex and mother's ethnicity in NYC in 2011-2014. For example, the first record indicates that in 2011, when the mother is Hispanic and the baby is female, 13 were named GERALDINE. BRTH_YR Gender ETHCTY Name Count 2011 FEMALE HISPANIC GERALDINE 13 Only analyze the dataset for the years 2012 - 2014, so...

  • Exercise 2. [Data analysis, requires R] For this questions use the bac data set from the...

    Exercise 2. [Data analysis, requires R] For this questions use the bac data set from the openintro library. To access this data set first install the package using install.packages ("openintro") (this only needs to be done once). Then load the pack- age into R with the command library(openintro). You can read about this data set in the help menu by entering the command ?openintro or help(openintro). Many people believe that gender, weight, drinking habits, and many other factors are much...

  • Use the code below to answer questions # 1-5. library (data.table) M3-data. frame (x-1:5,y-seq (2...

    Use the code below to answer questions # 1-5. library (data.table) M3-data. frame (x-1:5,y-seq (2,10,2),z-7:3) setDT (M3) 1. What is sum(M3L,3])? 2. What is sum(M3[,2)? 3. What is sum(M3+rep(2,5))? 4. What is M3ly6,x]? 5. What is sum(M31,21+M3Lx)D Use the code below to answer questions # 1-5. library (data.table) M3-data. frame (x-1:5,y-seq (2,10,2),z-7:3) setDT (M3) 1. What is sum(M3L,3])? 2. What is sum(M3[,2)? 3. What is sum(M3+rep(2,5))? 4. What is M3ly6,x]? 5. What is sum(M31,21+M3Lx)D

  • 1. Pleae choose one stock data from Yahoo Finance website. 2. Please use RStudio program for...

    1. Pleae choose one stock data from Yahoo Finance website. 2. Please use RStudio program for data analysis. 3. Please do (1) Polinomial equation modeling, (2)ARIMA modeling, (3)Model diagonatics, (4) GARCH modeling with your chosen stock data. 4. Please compare and intrepret of outputs of the four models. use these r codes to get the data, please use RStudio to answer these questiones, and please provides the R code. install.packages("TSA") install.packages("tseries") library(tseries) library(TSA) con <- url("https://finance.yahoo.com") if(!inherits(try(open(con), silent = TRUE),...

  • Description: In this project, you are asked to install virtualization software on a host computer, install...

    Description: In this project, you are asked to install virtualization software on a host computer, install guest operating system on the virtual machine, and finally set up a web server in the guest operating system. Host Operating System: Your host operating system can be any operating system you are familiar with and have access to. Virtualization Software: VMWare Workstation Player or VirtualBox Guest Operating System: Ubuntu Web Server: Apache Steps: 1. Install Virtualization software a. VMWare Player i. Free download...

  • Height vs Weight - Erroneous Data: You will need to use software to answer these questions....

    Height vs Weight - Erroneous Data: You will need to use software to answer these questions. Below is the scatterplot, regression line, and corresponding data for the height and weight of 11 randomly selected adults. You should notice something odd about the last entry.           index height (x) weight (y) inches pounds 1 60 120 2 72 200 3 65 130 4 72 205 5 67 180 6 69 180 7 68 193 8 69 195 9 61 115 10...

  • Use R statistical software to answer the following: 2. Let x1 , ..., xn be a...

    Use R statistical software to answer the following: 2. Let x1 , ..., xn be a random sample from the normal distribution with mean 0 and variance θ. (a) Find the mle of θ (b) Find the Fisher information I(θ)

  • Use the data given below to perform a regression through the origin and answer questions 1...

    Use the data given below to perform a regression through the origin and answer questions 1 4 Source Regression Error Total Df 1 MS 59.756 3.561 59.76 14.24 1. 2. 3. Fit the model Y = β|X + ε. What is your predicted value of β? (Round your answer to three decimal places) What should be the value of A, the degrees of freedom for error, in the ANOVA table for the regression through the origin? What should be the...

  • Question 34 (8 points) Use the circuit diagram below to answer the questions that follow. l;...

    Question 34 (8 points) Use the circuit diagram below to answer the questions that follow. l; = 10 A R. = ? 12 = 2 R = 40 V-= 20 V EPIC a) What is the resistance of R1? (2 marks) Wb) What is the current through R2? (2 marks) c) What is the current through the energy source? (2 marks) d) What is the total resistance in the circuit? (2 marks)

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT