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.
sales <- data.frame( rep = c("Ali", "Bea", "Cy", "Dan", "Eve", "Fay", "Gus", "Hal"), region = c("West", "East", "West", "West", "North", "West", "East", "West"), units = c(12, 15, 8, 10, 20, 25, 9, 10) ) nrow(sales[sales[, "region"] == "West" & sales[, "units"] >= 10, ])
What number does the last line print? Give your answer as a whole number.
Unlock full course notes by signing up
Track a data frame's shape through several steps
A ride-share analyst runs the R code below on trip records for six drivers.
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.