A ride-share analyst runs the R code below on trip records for six drivers.
trips <- data.frame( driver = c("A", "B", "C", "D", "E", "F"), km = c(12, 40, 7, 33, 18, 52), fare = c(15, 46, 10, 39, 22, 60) ) trips[, "per_km"] <- trips[, "fare"] / trips[, "km"] long <- trips[trips[, "km"] > 15, c("driver", "per_km")]
After the code runs, give each of the following as a whole number: the number of columns in trips, the number of rows in long, and the number of columns in long.
Unlock full course notes by signing up
Count rows kept by a two-condition filter
A sales manager keeps the following data frame of representatives in R and wants to count the West-region representatives who sold at least 10 units.
What number does the last line print? Give your answer as a whole number.