Hi, I'm new to R studio and trying to do a scatterplot on variables with high correlation in a dataset. The code should be correct but I'm still getting errors.
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) : <text>:1:5: unexpected symbol
1: SAT Math
^
What could be causing this error? Everything has been working up to this moment. Thank you very much for your help!
To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:
I suggest you check whether the column name SAT MathAvg. Score is correct. If it is, change it so it does not contain any spaces.
If that does not fix the problem, please post a reprex as requested by andresrcs.