computes replicates across a vector

Description

Given a vector, returns the replicates in order

Usage

1

Arguments

x

character or numeric vector

Value

numeric vector

Author(s)

Henrique Dallazuanna

References

R-help mailing list

See Also

rle

Examples

1
2
  x <- c('a','b','a','a','b','a','c','c','c')
  data.frame(val=x,rep=replicates(x))

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.