| get.all.word.pairs.frequency | R Documentation |
Use multiple times the function freq.of.all.combinations.df to count all combinations between each concecutive pair of variables of wordvars ( var1 - var2, var2 - var3, ..., var_n-1 - var_n). Then combines all pair frequencies into one data frame with the columns "word1code" "word2code" "word1" "word2" "cumsums"
get.all.word.pairs.frequency(wordvars, data.df, iscircled = FALSE)
wordvars |
The vector containing the names of the variables |
data.df |
The data frame where the variables belong. |
iscircled |
Should take also the combination between last and first variable (var_n - var1)? Default is FALSE. |
A data frame contains the columns "word1code" "word2code" "word1" "word2" "cumsums"
Epaminondas Diamantopoulos
# 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.all.pairs.frequency = get.all.word.pairs.frequency(c("diet1stword",
"diet2ndword", "diet3rdword"), freeassociationdata_part)
head(df.all.pairs.frequency)