freq_by_polarity: Query the dataset for frequency by polarity based on several...

Description Arguments Value Examples

Description

Query the dataset for frequency by polarity based on several filters and return the raw data, frequency data and a plot for the same.

Arguments

data

the sentiment dataset containing variables user for username, date for date and text for text of the tweet. default sentiment140_train dataset

user_list

a vector of users for which to filter the dataset.

start_date_time

input start_date_time in POSIXct format on which to filter the dataset

end_date_time

input end_date_time in POSIXct format on which to filter the dataset

keyword_list

a list of string keywords on which to filter the dataset

Value

a list object with raw filtered dataframe, frequency dataframe that holds the frequency counts by polarity and a plot depicting the relationship between the two

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
library(lubridate)
sample_data <- data.frame("user" = c("test_user1", "test_user1", "test_user2"),
                          "date" = c(lubridate::as_datetime("2009-04-01"),
                                     lubridate::as_datetime("2009-04-05"),
                                     lubridate::as_datetime("2009-04-10")),
                          "text" = c("Sample tweet 1 from user1",
                                     "Sample tweet 2 from user1",
                                     "Sample tweet 1 from user2"),
                         "polarity" = c(0, 4, 4),
                         "id" = c(1,2,3))
freq_by_polarity(data = sample_data,
                 user_list = c("", "test_user1"),
                 start_date_time = lubridate::as_datetime("2009-03-30"),
                 end_date_time = lubridate::as_datetime("2009-06-30"),
                 keyword_list = c("tweet 2"))

adityamangal410/deepSentimentR documentation built on June 3, 2019, 6:15 p.m.