The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

wordorientation

Detect attraction and repulsion between words in text.

What it does

For every pair of words that co-occur often enough to analyze, wordorientation computes the phi coefficient (a correlation measure for binary co-occurrence data), tests it for significance, and classifies the pair as:

Installation

# once on CRAN
install.packages("wordorientation")

# development version
# devtools::install_github("yourusername/wordorientation")

Usage

library(wordorientation)

result <- analyze_word_orientation(
  example_social_posts(),
  text_col = "text", doc_col = "id",
  min_count = 2
)

head(result$scored)
plot_orientation_network(result$scored)

Or step by step:

tokens <- tokenize_posts(my_data, text_col = "text")
cooc   <- cooccurrence_counts(tokens, min_count = 5)
scored <- word_orientation(cooc, alpha = 0.05)

wordorientation combines tokenization, co-occurrence counting, significance-tested classification, and network visualization into a single general-language pipeline.

Multiple comparisons

By default, word_orientation() applies a Benjamini-Hochberg correction across all tested word pairs (p_adjust_method = "BH"). On small corpora with few documents, this can mean no pair survives correction even when raw phi values look large — this is intentional, not a bug: it guards against over-interpreting spurious associations from sparse data.

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.