whe_sentiment: Sentiment

Description Usage Arguments Examples

Description

Get Sentiment score from text.

Usage

1
2
3
4
5
6
7
whe_sentiment(wh, method = "afinn", ...)

## S3 method for class 'character'
whe_sentiment(wh, method = "afinn", ...)

## S3 method for class 'data.frame'
whe_sentiment(wh, method = "afinn", ...)

Arguments

wh

highlighted object returned by wh_collect, see examples.

method

Sentiment method passed to get_sentiment.

...

Any other parameters to pass to get_sentiment.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
library(webhose)
token <- wh_token("xXX-x0X0xX0X-00X")

token %>%
  wh_news(q = '"R programming language"') %>%
  wh_collect() -> rstats # collect results

sent <- rstats %>%
  whe_sentiment()

library(dplyr)

rstats %>%
  mutate(sent = whe_sentiment(text))

## End(Not run)

JohnCoene/webhoserx documentation built on June 15, 2019, 3:48 p.m.