Categories
Mastering Development

How to use a cut in prolog to find the number of daughters?

Exercise: Observe the family structure below where each person has a gender specification as their third parameter (m = male, f = female). Use a cut to write the predicate numDaughters(L, Count) in such a way that family(Husband, Wife, Kids), numDaughters([Husband, Wife|Kids],X) lists each family in the database and the number of daughters in each […]

Categories
Mastering Development

Add a custom Axis label with unique color and size

I have the following chart: df<- data.frame(year=c(1960,1961,1962),value=c(10,18,20)) ggplot(df,aes(x=year,y=value))+geom_col()+ geom_hline(yintercept =18,linetype="dashed", color = "red",size=1) I would like to add a red label in the Y axis with the text "Actual Value" where the red line is. I know i cann add the text changing breaks, but then i could not have the new text in red. […]

Categories
Development

How can I get facet_wrap to work correctly with this sorted stacked area graph?

I got some help to sort my stacked area graph in this questions: Earlier question Now I tried to add another variable, which I want to use facet_wrap on. I have tried to group by my new variable “measures”, but something is wrong since I get this figure: This is the new code, the only […]