details | R Documentation |
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.
details(x, y, ...) ## S3 method for class 'slma' details(x, y, shorten_names = TRUE, ...)
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 |
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 of x$scores
corresponding to y
.
scores
(what is printed by default), a dataframe with one row per
pair of documents in the slma
and the frequencies and association scores of
the chosen item as columns.
item
: the value of y
.
sig_cutoff
and small_pos
, as defined in slma
.
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)) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.