Imagine a data frame...
df <- rbind("title", "------------------", "quite long content", "quite long content", "------------------", "short cont", "short cont")
df <- as.data.frame(df)
df
...which prints:
> df
V1
1 title
2 ------------------
3 quite long content
4 quite long content
5 ------------------
6 short cont
7 short cont
I would like to add spaces to all elements below the last line (they can vary in number) so they align with elements in the other lines, such that:
> df
V1
1 title
2 ------------------
3 quite long content
4 quite long content
5 ------------------
6 short cont
7 short cont
Could someone help me with a way to achieve this? Many thanks in advance.