replicates: 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))

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.