# NOT RUN {
use("polmineR")
# Scenario 1: Decode one or two s-attributes
dt <- decode("REUTERS", s_attribute = "id")
dt <- decode("REUTERS", s_attribute = c("topics_cat", "places"))
# Scenario 2: Decode entire corpus
dt <- decode("REUTERS")
# Scenario 3: Decode partition
p <- partition("REUTERS", places = "kuwait", regex = TRUE)
dt <- decode(p)
# Scenario 4: Decode partition_bundle
pb <- partition_bundle("REUTERS", s_attribute = "id")
dts <- lapply(as.list(pb), decode)
dts <- lapply(names(dts), function(n) dts[[n]][, speech_id := n])
dt <- data.table::rbindlist(dts)
# }
Run the code above in your browser using DataLab