Description Usage Arguments Details Examples
For each document, the k
top topics are evaluated.
1 2 3 4 5 6 7 8 9 10 |
x |
A topicmodel inheriting from class |
... |
Further arguments. |
k |
An |
regex |
Regular expression to extract the date from the document name, defaults to match pattern YYYY-MM-DD. |
select |
An |
aggregation |
Either "year", "quarter" or "month", if |
The document names of the LDA
object are assumed to include a date
that can be extracted by using a regular expression (argument regex
).
If argument select
is NULL
, the time series is prepared for
all topics. If select
is a length-one integer
value, the time
series is reported only for single topic. If select
is a length-two
integer
vector, the dispersion of the co-occurrence of the two topics
across time is returned.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | data(BE_lda, BE_labels)
# The document names are assumed to include a date that can be
# extracted and parsed
head(BE_lda@documents)
# Get time series for all topics
z <- as.zoo(BE_lda, k = 3L, aggregation = "year")
dim(z)
colnames(z) <- BE_labels
plot(z[,grep("Asyl", BE_labels)]) # subsequent subsetting
# Get time series for a single topic
z <- as.zoo(BE_lda, k = 3L, aggregation = "year", select = grep("Asyl", BE_labels))
plot(z)
# Get time series for the co-occurrence of two topics
z <- as.zoo(BE_lda, k = 3L, select = c(28L, 203L), aggregation = "month")
z <- as.zoo(
BE_lda, k = 3L,
select = c(
grep("Asyl", BE_labels),
grep("Integration", BE_labels)
)
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.