Learn R Programming

a4 (version 1.20.0)

replicates: computes replicates across a vector

Description

Given a vector, returns the replicates in order

Usage

replicates(x)

Arguments

x
character or numeric vector

Value

  • numeric vector

References

R-help mailing list

See Also

rle

Examples

Run this code
x <- c('a','b','a','a','b','a','c','c','c')
  data.frame(val=x,rep=replicates(x))

Run the code above in your browser using DataLab