Theme | R Documentation |
The stoRy package uses the Theme
R6 class to represent individual
LTO literary themes. This class is mostly useful for accessing information
about an LTO theme for which the theme name is known in advance.
The class operates on the themes of whichever LTO version happens to be
actively loaded into the stoRy package level environment. This is
the LTO demo
version by default. Run which_lto()
to check which LTO
version is active in your R session.
Search the latest LTO dev
version themes on the Theme Ontology website at
https://www.themeontology.org/themes.
new()
Initialize an LTO theme.
Theme$new(theme_name)
theme_name
A length-one character vector corresponding to an LTO theme name.
A new Theme
object.
theme_name()
return A length-one character vector corresponding to the theme name.
Theme$theme_name()
aliases()
return A tibble of theme name aliases.
Theme$aliases()
description()
return A length-one character vector corresponding to the theme description.
Theme$description()
notes()
return A tibble of caveats that accompany that theme description. This is empty for the vast majority of themes.
Theme$notes()
references()
return A tibble of references.
Theme$references()
examples()
return A tibble of example usages of the theme, if any.
Theme$examples()
parents()
return A tibble of the theme's parent theme names.
Theme$parents()
ancestors()
return A tibble of the theme's ancestor theme names.
Theme$ancestors()
source()
return The path of the th.txt file containing the theme. This is the file path as it occurs on the Theme Ontology GitHub repository at https://github.com/theme-ontology/theming.
Theme$source()
annotations()
return A tibble with one row for each story in which the theme is featured. The first column is the LTO story ID, the second is the release data, the third is the level (choice/major/minor) at which the theme is featured, and the fourth a justification for applying the theme. Each column is of type character.
Theme$annotations()
print()
Print theme object info to console.
Theme$print(canonical = FALSE, width = NULL, ...)
canonical
Set to FALSE for pretty output.
width
Width of text output to generate. This defaults to NULL,
which means the stoRy_opt("width")
value is used. Run
options(stoRy.width = 120L)
to change the column width to be 120
characters, etc.
...
Additional arguments.
clone()
The objects of this class are cloneable with this method.
Theme$clone(deep = FALSE)
deep
Whether to make a deep clone.
Use Collection()
to initialize an collection of LTO thematically
annotated stories.
Use Story()
to initialize an LTO thematically annotated story.
Use Themeset()
to initialize a set of related LTO themes.
## Not run:
# Initialize an LTO `demo` version theme pertaining to Martians:
set_lto("demo")
theme <- Theme$new(theme_name = "Martian extraterrestrial")
# Print theme info to console:
theme
# Print theme info to console in the canonical th.txt format:
theme$print(canonical = TRUE)
# Return the theme description:
theme$description()
# Return references associated with the description, if any:
theme$references()
# Return theme name aliases, if any:
theme$aliases()
# Return the theme's parent theme names:
theme$parents()
# Return the theme's ancestor theme names:
theme$ancestors()
# Return a tibble of thematically annotated stories:
theme$annotations()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.