I want to auto-populate a variable in R with a value until the next value is reached in the column.
I want to turn this:
X Y
a 1
1
1
b 1
1
1
c 1
Into:
X Y
a 1
a 1
a 1
b 1
b 1
b 1
c 1