Package {warmthcompetence}


Type: Package
Title: Warmth and Competence Detectors
Version: 0.1.5
Description: Detects perceptions of warmth and competence in American English self-presentation language. Using trained elastic net regression models, this package provides a numerical representation of warmth and competence perceptions. Methods are described here:https://github.com/bushraguenoun/warmthcompetence/tree/master/paper.
License: AGPL (≥ 3)
Encoding: UTF-8
URL: https://github.com/bushraguenoun/warmthcompetence, https://bushraguenoun.github.io/warmthcompetence/
BugReports: https://github.com/bushraguenoun/warmthcompetence/issues
RoxygenNote: 7.3.3
Imports: spacyr, caret, dplyr (≥ 1.2.0), lexicon, ngram, qdap, politeness, qdapDictionaries, quanteda (≥ 4.0.2), sentimentr, stats, tidyr, tidytext, tm, quanteda.textstats
Depends: R (≥ 4.1.0)
Suggests: rmarkdown, knitr
LazyData: true
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2026-05-05 18:39:49 UTC; bguenoun
Author: Bushra Guenoun ORCID iD [aut, cre], Julian Zlatev ORCID iD [aut], Noah Greifer ORCID iD [ctb]
Maintainer: Bushra Guenoun <bushraguenoun@gmail.com>
Repository: CRAN
Date/Publication: 2026-05-11 18:40:02 UTC

warmthcompetence: Warmth and Competence Detectors

Description

Detects perceptions of warmth and competence in American English self-presentation language. Using trained elastic net regression models, this package provides a numerical representation of warmth and competence perceptions. Methods are described here:https://github.com/bushraguenoun/warmthcompetence/tree/master/paper.

Author(s)

Maintainer: Bushra Guenoun bushraguenoun@gmail.com (ORCID)

Authors:

Other contributors:

See Also

Useful links:


Competence Detector

Description

Assesses warmth and competence perceptions in self-presentational natural language. These functions each take an N-length vector of self-presentational text documents and N-length vector of document IDs and return a warmth/competence perception score that represents how much warmth/competence others attribute the individual who wrote the self-presentational text. The function also contains a metrics argument that enables users to also return the raw features used to assess warmth and competence perceptions. Methods are described here:https://github.com/bushraguenoun/warmthcompetence/tree/master/paper.

Usage

competence(text, ID = NULL, metrics = "scores")

warmth(text, ID = NULL, metrics = "scores")

Arguments

text

character; a vector of texts, each of which will be assessed for warmth/competence.

ID

character; a vector of IDs that will be used to identify the warmth/competence scores.

metrics

character; an argument that allows users to decide what metrics to return. Users can return the warmth/competence scores (metrics = "scores"), the features that underlie the warmth/competence scores (metrics = "features"), or both the warmth/competence scores and the features (metrics = "all"). The default is to return the warmth/competence scores.

Details

Some features depend on Spacyr which must be installed separately in Python.

Value

The default is to return a data frame with each row containing the document identifier and the warmth/competence score. Users can also customize what is returned through the metrics argument. If metrics = "features", then a data frame of warmth/competence features will be returned where each document is represented by a row. If metrics = "all", then both the warmth/competence scores and features will be returned in a data frame.

References

Benoit, K., Watanabe, K., Wang, H., Nulty, P., Obeng, A., Müller, S., & Matsuo, A. (2018). quanteda: An R package for the quantitative analysis of textual data. Journal of Open Source Software, 3(30), 774. doi:10.21105/joss.00774

Buchanan, E. M., Valentine, K. D., & Maxwell, N. (2018). The LAB: Linguistic Annotated Bibliography.

Rinker, T. W. (2018). lexicon: Lexicon Data version 1.2.1.

Rinker, T. W. (2021). sentimentr: Calculate Text Polarity Sentiment version 2.9.0.

Yeomans, M., Kantor, A., & Tingley, D. (2019). The politeness Package: Detecting Politeness in Natural Language. The R Journal, 10(2), 489. doi:10.32614/RJ-2018-079

Examples


data("example_data")

warmth_scores <- warmth(example_data$bio, metrics = "all")

example_data$warmth_predictions <- warmth_scores$warmth_predictions
warmth_model1 <- lm(RA_warm_AVG  ~ warmth_predictions, data = example_data)
summary(warmth_model1)

competence_scores <- competence(example_data$bio, metrics = "all")

example_data$competence_predictions <- competence_scores$competence_predictions
competence_model1 <- lm(RA_comp_AVG ~ competence_predictions, data = example_data)
summary(competence_model1)


Example Data

Description

40 random bios from the vignette data. 20 bios were randomly selected from the competence condition and 20 bios were randomly selected from the warmth condition.

Usage

example_data

Format

A dataframe with 40 rows and 11 columns


Vignette Data

Description

Sample data from a study that can be used to test and explore the package. In this study, participants were asked to present themselves in either a warm or competent manner. Then, three judges blind to participant condition coded the introductions for warmth and competence.

Usage

vignette_data

Format

A dataframe with 393 rows and 11 columns


A function to format text

Description

Contains functions that are used by the main functions of the warmthcompetence package for text processing.

Usage

words_clean(text, ID)

Arguments

text

character A vector of texts

ID

character A vector of IDs

Details

Some features depend on Spacyr which must be installed separately in Python.

Value

Tibbles that are used by the main functions of the warmthcompetence package