Kcombination: Kcombination returns the list of all possible combinations of...

Description Usage Arguments Value Examples

View source: R/RcppExports.R

Description

This function, given a vector of numbers, will return all the possible combinations of a given length k.

Usage

1
Kcombination(data, k, selector)

Arguments

data

the vector of numbers (i.e. elements) to consider.

k

the length of the returned combination (between 2 and 6 in this version).

selector

if set, returns only the combinations containing this number.

Value

Return a list of all possible combinations for the given vector of numbers.

Examples

1
2
3
4
5
6
   ## Returns the k-combination of the list of numbers: 1,2,3 of length=2.
   ## i.e. (1,2), (1,3), (2,3) 
	Kcombination(c(1,2,3),k=2)
   ## Returns only the k-combination containing the number 1.
   ## i.e. (1,2), (1,3)	
	Kcombination(c(1,2,3),k=2,selector=1)

Example output

Loading required package: Rcpp
Loading required package: clusterCrit
Loading required package: cluster
Loading required package: copula
Loading required package: WeightedCluster
Loading required package: TraMineR

TraMineR stable version 2.2-1 (Built: 2020-11-21)
Website: http://traminer.unige.ch
Please type 'citation("TraMineR")' for citation information.

This is WeightedCluster stable version 1.4-1 (Built: 2020-11-21)

To get the manuals, please run:
   vignette("WeightedCluster") ## Complete manual in English
   vignette("WeightedClusterFR") ## Complete manual in French
   vignette("WeightedClusterPreview") ## Short preview in English

To cite WeightedCluster in publications please use:
Studer, Matthias (2013). WeightedCluster Library Manual: A practical
   guide to creating typologies of trajectories in the social sciences
   with R. LIVES Working Papers, 24. doi:
   10.12682/lives.2296-1658.2013.24
[[1]]
[1] 1 2

[[2]]
[1] 1 3

[[3]]
[1] 2 3

[[1]]
[1] 1 2

[[2]]
[1] 1 3

ClusterStability documentation built on May 2, 2019, 1:59 p.m.