plot_ts: Group the documents into date, and plot the time series

Description Usage Arguments Value Author(s) Examples

Description

Plot the time series of sentiment, topics, etc

Usage

1
2
plot_ts(df, date, v, w = 1, stat = "sum", method = "loess", span = 0.1,
  xlab = "date", ylab = NULL, color = NULL, display = FALSE)

Arguments

df

A merged data frame

date

The name of the variable identifying the date

v

The name of the variable you want to plot

w

The name of the weighting variable when doing aggregation. If default to 1, then unweighted.

stat

A character specifying the method to aggregate the documents into date stat = c("sum", "mean")

method

A character specifying the method in ggsmooth

span

An numeric specifying the smoothness. The larger the smoother. Default to 0.1

display

A logical. If TURE, then print the plot

Value

A ggplot

Author(s)

Jiacheng He

Examples

1
2
plot_ts(merged, DOCUMENT_DATE, score, w = LENGTH, stat = "mean", span = 0.1,
        ylab = "sentiment score")

JiachengHe/TextAnalysis documentation built on May 28, 2019, 7:51 a.m.