Hi, I’m stuck on an error when trying to create scatterplots for Guided Project NYC Schools Perceptions in R Studio. I get errors whether I follow the solution or try to do them manually. Everything works up to this moment:
ggplot(data = combined_survey) +
-
aes_string(x = "SAT Math Avg. Score", y = "avg_sat_score") +
-
geom_point(alpha = 0.3) +
-
theme(panel.background = element_rect(fill = "white"))
Error in parse(text = x) : :1:5: unexpected symbol
1: SAT Math
^
Here are the solutions that I have been following (https://github.com/dataquestio/solutions/blob/master/Mission327Solutions.Rmd)
and it gives me the same error when I do:
create_scatter <- function(x, y) {
ggplot(data = combined_survey) +
aes_string(x = x, y = y) +
geom_point(alpha = 0.3) +
theme(panel.background = element_rect(fill = “white”))
}
x_var <- strong_cors$variable[2:5]
y_var <- “avg_sat_score”
map2(x_var, y_var, create_scatter)
Please help!