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 slma.

y

A character vector of length one representing one linguistic item.

...

Additional arguments.

shorten_names

Logical. If TRUE, filenames in the rownames are shortened with short_names().

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:

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))
} 

[Package mclm version 0.2.7 Index]