Hi there!
I would like to ask how can I create specific colour for each data frame. In this code below, I want to illustrate the correlations between utopian thinking and each of the wellbeing subscale (Autonomy, Environmental_Mastery, Personal_Growth, Positive_Relations, Purpose_in_life, Self_acceptance) in Carol Ryff's wellbeing scale. Since i want each subscale to have a specific color for its datapoint but I can only do so with the best fitted lines. I would like to know is there specific argument to help me with that?
Much appreciated.
Nam.
Here is the code:
UW_long <- recode_UW %>%
select(c(Utopianism, Autonomy, Environmental_Mastery, Personal_Growth, Positive_Relations, Purpose_in_life, Self_acceptance)) %>%
pivot_longer(cols=c(Autonomy, Environmental_Mastery, Personal_Growth, Positive_Relations, Purpose_in_life, Self_acceptance), names_to="wellbeing_subscale", values_to="scores")
#Figure 7
UW_long_corrplot <- UW_long %>%
ggplot(aes(x=Utopianism, y=scores, fill=wellbeing_subscale,show.legend=FALSE)) +
geom_point(show.legend=FALSE) +
facet_wrap(facets = ~ wellbeing_subscale) +
theme_classic() +
#theme(strip.background=element_rect(fill="white")) +
labs(x="Utopianism",
y="Wellbeing scores (Wellbeing subScales)") +
geom_smooth(method = "lm", se = TRUE)
plot(UW_long_corrplot)
Here is the graph