ap_2010 <- read.csv("ap_2010.csv") library(purrr) map(ap_2010, class) library(dplyr) ap_2010 <- ap_2010 %>% mutate(across(`AP.Test.Takers`: `Number.of.Exams.with.scores.3.4.or.5`, as.numeric)) %>% mutate(exams_per_student = `Total.Exams.Taken` / `AP.Test.Takers`) %>% mutate(high_score_percent = (`Number.of.Exams.with.scores.3.4.or.5`/ `Total.Exams.Taken`) * 100)
What I expected to happen:
When I ran this code, I did get the output I expected - the revised data frame with 2 new columns with the values - even with the error codes for the three variables in this pattern:
Warning message: “Problem with `mutate()` input `..1`. ℹ NAs introduced by coercion ℹ Input `..1` is `across(AP.Test.Takers:Number.of.Exams.with.scores.3.4.or.5, as.numeric)`.” Warning message in fn(col, ...): “NAs introduced by coercion”
What actually happened:
I get the expected outcomes, but when I click “Submit Answer”, I get this:
Running your code caused an error. ap_2010 is a data.frame, but we expected it to be a ['spec_tbl_df', 'tbl_df', 'tbl', 'data.frame'].
I don’t understand why I am getting this error. Any suggestions/assistance are appreciated!