keywordComb: Count all combinations of elements in vector and make it as...

Description Usage Arguments Examples

View source: R/keywordComb.R

Description

keywordComb count all combinations of elements in vector. Usually, this function used for network analysis when calculate weight between nodes(or vertexs). Please refer more details from github or example.

Usage

1
keywordComb(x, m = 2, remove_dup = F, self_conn = F)

Arguments

x

a vector which have more than m element(length(x) >= m).

m

a number of combination. Default set as 2.

remove_dup

if TRUE, use only unique elements in vectors(which means remove duplicates).

self_conn

if TRUE, allow nodes which have a self-connection, meaning an edge from itself to itself.

Examples

1
2
3
4
 comb2 <- keywordComb(as.character(c(1,1,2,2,1,5,5,3,6,5,3,5)),
                      m = 2, remove_dup = FALSE, self_conn = FALSE)
 comb3 <- keywordComb(as.character(c(1,1,2,2,1,5,5,3,6,5,3,5)),
                      m = 3, remove_dup = FALSE, self_conn = TRUE)

lawine90/elseR documentation built on Feb. 7, 2020, 8:22 a.m.