我尝试使用mgsub
({clean}包)和replace_emoji_identifier
在使用lexicon包的表情符号标识符替换表情符号前后添加一个空格。有谁知道我如何在以下代码上成功添加mgsub来添加trailing_space = TRUE
和leading_space = TRUE
?
#replace emojis with identifier to be used `enter code here`with sentimentr later
tw_work$text <- tw_work$text %>%
replace_emoji_identifier(text, emoji_dt = lexicon::hash_emojis_identifier)