Hi! I am having the same problem that Thomas had but I am not being able to solve it.
using RCall
@rlibrary ggplot2
@rlibrary gridExtra
@rlibrary scales
using DataFrames
df = DataFrame(Marital_Status = [“Marriage”, “Cohabitation”, “Marriage”, “Cohabitation”,
“Marriage”, “Cohabitation”, “Marriage”, “Cohabitation”],
Source = [“Model”, “Model”, “Data”, “Data”, “Model”, “Model”, “Data”, “Data”],
Education = [“Low Educated”, “Low Educated”, “Low Educated”, “Low Educated”,
“High Educated”, “High Educated”, “High Educated”, “High Educated”],
w = [0.3, 0.4, 0.5, 0.7, 0.1, 0.2, 0.5, 0.6])
a = ggplot(df, aes(x=:Source, y=:w, fill=:Marital_Status)) +
geom_bar(colour=“black”, stat=“identity”,
position=position_dodge(),
size=.3) + # Thinner lines
ylim(0, 1) +
scale_fill_hue(name=“Marital Status”) + # Set legend title
xlab(“”) + ylab(“Labor Force Participation”) + # Set axis labels
facet_wrap(R"~Education", ncol=1, scales = “free_y”) +
ggtitle(“Female Labor Force Participation”)
The codes works until here but when I add the theme function it does not work:
- R"““theme(strip.background = element_rect(colour=“black”,
fill=“white”))””"
I tried to wrap it in R"“” r code here “”" as suggested, but still the error message says: could not find function “theme” . What I am doing wrong? I also tried R"r code", and:
r = R “”" theme(strip.background = element_rect(colour=“black”,
fill=“white”)) “”"
and adding that to my ggplot. Could you tell me what I am missing? I am just starting with Julia and ggplot, so sorry if this was answered.
Thanks!!!