smooth_lss | R Documentation |
Smooth predicted polarity scores by local polynomial regression
smooth_lss(
x,
lss_var = "fit",
date_var = "date",
span = 0.1,
group = NULL,
from = NULL,
to = NULL,
by = "day",
engine = c("loess", "locfit"),
...
)
x |
a data.frame containing polarity scores and dates. |
lss_var |
the name of the column in |
date_var |
the name of the column in |
span |
the level of smoothing. |
group |
the name of the column in |
from , to , by |
the the range and the internal of the smoothed scores; passed to seq.Date. |
engine |
specifies the function to be used for smoothing. |
... |
additional arguments passed to the smoothing function. |
Smoothing is performed using stats::loess()
or locfit::locfit()
.
When the x
has more than 10000 rows, it is usually better to choose
the latter by setting engine = "locfit"
. In this case, span
is passed to
locfit::lp(nn = span)
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.