Using air_df data frame below.       airline origin destination daily_freq 1 QF SYD MEL 20 2 JQ SYD MEL 15 3 VA SYD MEL 17 4 QF SYD BNE 10 5 JQ SYD BNE 9 6 VA SYD BNE 6 7 QF MEL BNE 8 8 JQ MEL BNE 7 9 VA MEL BNE 11 10 QF MEL PER 7 11 VA MEL PER 5 You ran the following code in R: air_df_1 <- air_df %>% group_by(destination, origin) %>% summarise(total = sum(daily_freq)) If you execute air_df_1, what would you see on the Console? Note: You don't have to calculate the sum's. For a given destination and origin pair, the total is the same across all the options below.Single choice

A

destination origin total   <chr>       <chr>   <dbl> 1 BNE         MEL       26 2 BNE         SYD       25 3 MEL         SYD       52 4 PER         MEL       12

B

destination origin total   <chr>       <chr>   <dbl> 1 MEL         SYD       52 2 BNE         SYD       25 3 BNE         MEL       26 4 PER         MEL       12

C

destination origin total   <chr>       <chr>   <dbl> 1 MEL         SYD       52 2 BNE         MEL       26 3 BNE         SYD       25 4 PER         MEL       12

D

destination origin total   <chr>       <chr>   <dbl> 1 PER         MEL       12 2 MEL         SYD       52 3 BNE         SYD       25 4 BNE         MEL       26

Log in for full answers

We've collected over 50,000 authentic original questions and detailed explanations from around the globe. Log in now and get instant access to the answers!

Similar Questions

Suppose df has 50 rows with 3 numeric columns named x, y, and z. When you executed length(which(df$x >= 10)) the output returned is 10. Then, you executed df <- df %>% mutate(x = if_else(x >= 10, 10, -10)) What would be the result of the following line of code? length(which(df$x == -10))

Suppose you have given a subset of our North American Stock Market dataset in a data frame called compdf. There are all the 50 columns. Similar to our North American Stock Market dataset, gvkey and fyear combination uniquely identifies each observation in compdf. If you execute length(unique(compdf$loc)), you are returned 7. If you execute compdf %>% group_by(gvkey) %>% summarise(count = n()) , all the values under count column are 20.  Suppose you executed the following code successfully. df1 <- compdf %>% group_by(loc, fyear) %>% summarise(stat1 = mean(at, na.rm = TRUE), stat2 = max(stat1))   df1 should have ____ rows and 4 columns.  

Jeremy ran length(unique(csds$color)) and was returned 7. Later that day, Jeremy was informed that CSDS will have a promotion during the Holiday season. The management has decided to sell diamonds at discounted prices. The discount that would be applied will be based on color and expressed in discount data frame below. color_class percent 1 E 0.20 2 I 0.15 3 H 0.15 4 F 0.10 5 D 0.05   Jeremy wanted to create a summary table to report the average current price (i.e. average price without discount applied) and the average discounted price per color and clarity combination. Please complete the code below.   csds_summary <- csds %>% ____A____ (____B____, by = c("____C____" = "____D____")) %>% mutate(discounted = ____E____ ( ____F____ (percent), price, (1-percent)*price)) %>% group_by(color, clarity) %>% summarise(average_current = mean(price), average_discounted = mean(discounted))   ____A____ [ Select ] left_join right_join ____B____ [ Select ] csds discount ____C____ [ Select ] color carat dimond_id color_class percent ____D____ [ Select ] color percent color_class discount ____E____ [ Select ] sum mean if_else na.omit ____F____ [ Select ] na.rm is.na n_distinct

Two of your friends were having an argument over how to rename a column. Renaming is changing the name of a column with a new name. It turned out that they had a data frame (called df) with one column (called soze). They wanted to rename that column as keyser. One of them suggested the following: df <- df %>% mutate(keyser = soze) %>% select(-soze) The code above effectively renames the column name as they wanted.

More Practical Tools for Students Powered by AI Study Helper

Join us and instantly unlock extensive past papers & exclusive solutions to get a head start on your studies!