I have the following dataframe, which I want to plot:
df = data.frame(
a = 1:2,
b = 1:2)
p = ggplot(df, aes(a,b))
p + geom_line()
which is fine, but I want to be able to set different sorts of line types, as I have several groups. I visit this website: http://www.sthda.com/english/wiki/ggplot2-line-types-how-to-change-line-types-of-a-graph-in-r-software#change-manually-the-appearance-of-lines. I tried
p + geom_line(linetype = 'dashed')
Yet I would like a way to build the line exactly as I want (i.e., not from ready-to-use templates). For example, a line made of long lines and long blanks. Any idea?



