function_freq_of_all_combinations: Count all combinations between the values of column1 and...

Description Usage Arguments Value Author(s) Examples

Description

Count all combinations between the values of column1 and column2 and return a data frame with the combination of the items and the respecting frequencies.

Usage

1
freq.of.all.combinations.df(column1, column2, data.df, order = 0, removeNA = TRUE)

Arguments

column1

The name of the first column

column2

The name of the second column

data.df

The data frame containing the columns column1, column2

order

0 (default): no order, 1: descenting frequancy order, 2: ascenting wordcode order, 3: ascenting word order.

removeNA

Should remove any NA values or count them in their combination? Default is TRUE (remove NA).

Value

A data frame containing the frequencies of all pairs of values between column1 and column2. It counts all pair occurences independent of position, thus the pairs of (column1, column2): (a, b), (a, b), (b, a) will result to the entry in freq.of.all.combinations.df of (word1 = a, word2 = b, freq = 3).

Author(s)

Epaminondas Diamantopoulos

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# It is a time consuming function...
# Thus, for illustrative purposes, an example is provided in a small
# random subset of the original data...

freeassociationdata_part = dplyr::sample_n(freeassociationdata, 10)


df.with.frequencies = freq.of.all.combinations.df("diet1stword", "diet2ndword",
freeassociationdata_part)

head(df.with.frequencies)

wordgraph documentation built on July 1, 2020, 10:01 p.m.