Complete the code to create a tidy data frame with columns 'name' and 'score'.
data <- data.frame(name = c("Alice", "Bob"), score = c(85, [1]))
The score for Bob should be 90 to complete the data frame correctly.
Complete the code to select only the 'score' column from the tidy data frame.
library(dplyr)
scores <- data %>% select([1])We select the 'score' column to focus on the scores only.
Fix the error in the code to filter scores greater than 80.
filtered <- data %>% filter(score [1] 80)
To get scores greater than 80, use the '>' operator.
Fill both blanks to create a summary of average scores by name.
summary <- data %>% group_by([1]) %>% summarise(avg_score = mean([2]))
Group by 'name' and calculate mean of 'score' to summarize average scores.
Fill all three blanks to filter scores above 80, select 'name' and 'score', and arrange by score descending.
result <- data %>% filter(score [1] 80) %>% select([2], [3]) %>% arrange(desc(score))
Filter scores greater than 80, select 'name' and 'score' columns, then arrange by descending score.
