50% off: Unlimited data and AI learning.
State of Data and AI Literacy Report 2025

sentimentr (version 0.4.0)

replace_grade: Replace Grades With Words

Description

Replaces gradess with word equivalents.

Usage

replace_grade(text.var, grade_dt = sentimentr::grades, ...)

Arguments

text.var
The text variable.
grade_dt
A data.table of gradess and corresponding word meanings.
...
ignored.

Value

Returns a vector of strings with grades replaced with word equivalents.

Examples

Run this code
(text <- replace_grade(c(
    "I give an A+",
    "He deserves an F",
    "It's C+ work",
    "A poor example deserves a C!"
)))
sentiment(text)

Run the code above in your browser using DataLab