R/timeSeries.R
ShowAbsoluteTS.Rd
It creates time series with the absolute frequency of one or more terms, in one or more websites.
ShowAbsoluteTS(terms, dataset, type = "graph", specificWebsites = NULL, startDate = NULL, endDate = NULL, rollingAverage = 31, align = "center", verticalLine = NULL, smoothLine = FALSE, customTitle = NULL, export = FALSE, project = NULL, website = NULL)
terms | A character vector with one or more words to be analysed. |
---|---|
dataset | A `castarter` dataset. |
type | Type of output: either "graph" (default) or "data.frame". |
specificWebsites | Character vector of the names of one or more websites included in the corpus. Only selected websites will be included in the analysis. |
startDate | Character vector with date in the format year-month-date, e.g. "2015-07-14". Given dates are included, e.g. if you wish to include all of 2015, set startDate="2015-01-01", endDate"2015-12-31") |
endDate | Character vector with date in the format year-month-date, e.g. "2015-07-14". Given dates are included, e.g. if you wish to include all of 2015, set startDate="2015-01-01", endDate"2015-12-31") |
rollingAverage | Integer, defaults to 31. Number of days used to calculate word frequency as shown in the time series. Time series shows word frequency for each date as an average of the N number of days (N=rollingAverage) around the given date. If align = "centre", and rollingAverage = 31, this means that the value for each day corresponds to the average value for the given day, the 15 days before it, and the 15 days after it. |
align | Defaults to "center", can be either "left", "right" or "center" and refers to the way the rolling average is calculated. |
verticalLine | Defaults to NULL. Draws a vertical dotted line at the date provided. If given, value must correspond to one or more dates in the YMD format, e.g. "2016-08-17". |
smoothLine | Logical, defaults to FALSE. If TRUE draws a smooth line over the time series. |
customTitle | A character vector, defaults to NULL. If provided, it overrides default graph title. |
export | Logical, defaults to FALSE. If TRUE, saves the time series in both png and pdf format. If project and website are provided, in saves the timeseries in the "Outputs" subfolder. |
project | Name of 'castarter' project. Must correspond to the name of a folder in the current working directory. |
website | Name of a website included in a 'castarter' project. Must correspond to the name of a sub-folder of the project folder. |
# NOT RUN { ShowAbsoluteTS(terms = c("word1", "word2"), dataset) # }