details {mclm} | R Documentation |
Details on a specific item
Description
This method zooms in on details of an object x
based on an item y
.
When x
is of class slma
(currently the only supported class),
y
must be one of the lexical markers described in it.
Usage
details(x, y, ...)
## S3 method for class 'slma'
details(x, y, shorten_names = TRUE, ...)
Arguments
x |
An object containing global statistics for a collection of linguistic units,
such as an object of class |
y |
A character vector of length one representing one linguistic item. |
... |
Additional arguments. |
shorten_names |
Logical. If |
Value
An object with details. When x
is of class slma
,
the class of the output is details.slma
, namely a list with the following items:
-
summary
: The row ofx$scores
corresponding toy
. -
scores
(what is printed by default), a dataframe with one row per pair of documents in theslma
and the frequencies and association scores of the chosen item as columns. -
item
: the value ofy
. -
sig_cutoff
andsmall_pos
, as defined inslma
.
Examples
a_corp <- get_fnames(system.file("extdata", "cleveland", package = "mclm"))
b_corp <- get_fnames(system.file("extdata", "roosevelt", package = "mclm"))
slma_ex <- slma(a_corp, b_corp, keep_intermediate = TRUE)
gov <- details(slma_ex, "government")
gov$summary
# A bit of tidy manipulation to shorten filenames
if (require("dplyr") && require("tidyr")) {
as_tibble(gov, rownames = "files") %>%
tidyr::separate(files, into = c("file_A", "file_B"), sep = "--") %>%
dplyr::mutate(dplyr::across(dplyr::starts_with("file"), short_names))
}