mycount1: counts the unique values in a vector

Description Usage Arguments Value Author(s) Examples

View source: R/mycount1.R

Description

returns sorted unique values of x and how many times each appears

Usage

1

Arguments

x

Value

and their cardinality

v

sorted unique values in x

ct

cardinality of each of the values

Author(s)

Frederic Paik Schoenberg

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function(x){
    ## returns sorted unique values of x and how many times each appears
b1 = sort(unique(x),decreasing=T)
b2 = length(b1)
b3 = rep(0,b2)
for(i in 1:b2) b3[i] = sum(x == b1[i])
list(v=b1, ct = b3)
  }

holdem documentation built on May 2, 2019, 9:21 a.m.