replicates: computes replicates across a vector

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/replicates.R

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
3
  
x <- c('a','b','a','a','b','a','c','c','c')
  data.frame(val=x,rep=replicates(x))

Example output

Loading required package: a4Preproc
Loading required package: a4Core

a4Base version 1.38.0

  val rep
1   a   1
2   b   1
3   a   2
4   a   3
5   b   2
6   a   4
7   c   1
8   c   2
9   c   3

a4Base documentation built on Nov. 8, 2020, 5:41 p.m.

Related to replicates in a4Base...