Let us consider a vector x
, where
x=c(1,2,2,2,2,3,3,4,5,5,5,6,7,7,7).
I want to get the run vector (y
) obtained from the above vector, that is,
y= 1 4 2 1 3 1 3.
I think there may be a function in R to do this task but I don't that function. Could anyone please suggest me what function do this task in R. Thanks in advance.