Which native R function or which function in any other library would I be able to make a column listed with the one in the image below?
Dataset
lines = "Group
C
C
C
B
B
A
A
A
A
A
A
D
D
D
D
"
dataset = read.table(textConnection(lines), sep=";", h=T)
Which native R function or which function in any other library would I be able to make a column listed with the one in the image below?
Dataset
lines = "Group
C
C
C
B
B
A
A
A
A
A
A
D
D
D
D
"
dataset = read.table(textConnection(lines), sep=";", h=T)

Try with
cur_group_id()fromdplyr:Output:
Or using
base R:Output: