Learn R Programming

googlenlp (version 0.2.0)

flatten_sentiment: Flatten sentiment

Description

Convert the JSON/list sentiment response into a flattened data frame.

Usage

flatten_sentiment(sentiment_list)

Arguments

sentiment_list

The sentiment component of the API response.

Value

A flattened data frame.

Examples

Run this code
# NOT RUN {
sample_post <- gcnlp_post(text_body = "Google, headquartered in Mountain View, unveiled
                                       the new Android phone at the Consumer Electronic Show.
                                       Sundar Pichai said in his keynote that users love
                                       their new Android phones.",
                          extract_syntax = TRUE,
                          extract_entities = TRUE,
                          extract_document_sentiment = TRUE)

flatten_sentiment(sentiment_list = sample_post$content$sentiment)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab