Story | R Documentation |
The stoRy package uses the Story
R6 class to represent the LTO
thematic annotations for individual works of fiction. This class is mostly
useful for accessing information about an LTO thematically annotated story
for which the story ID is known in advance.
The class operates on the stories 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 stories on the Theme Ontology website
at https://www.themeontology.org/stories.
new()
Initialize an LTO thematically annotated story.
Story$new(story_id)
story_id
A length-one character vector corresponding to the ID of an LTO thematically annotated work of fiction.
A new Story
object.
story_id()
return A length-one character vector corresponding to the story ID.
Story$story_id()
title()
return A length-one character vector corresponding to the story title.
Story$title()
description()
return A length-one character vector corresponding to some summary information about the story. This is typically a synopsis and/or details about the authorship, production, distribution, etc.
Story$description()
date()
return A length-one character vector corresponding to the story release date.
Story$date()
references()
return A tibble of story reference urls, if any.
Story$references()
collections()
return A tibble of LTO collections to which the story belongs, if any.
Story$collections()
themes()
return A tibble of thematic annotations.
Story$themes()
source()
return The path of the st.txt file containing the story thematic annotations. This is the file path as it occurs on the Theme Ontology GitHub repository at https://github.com/theme-ontology/theming.
Story$source()
obj_internal_tbl()
return A special tibble that is used internally by package functions.
Story$obj_internal_tbl()
print()
Print story object info to console.
Story$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.
Story$clone(deep = FALSE)
deep
Whether to make a deep clone.
Use Collection()
to initialize an collection of LTO thematically
annotated stories.
Use Theme()
to initialize an LTO theme.
Use Themeset()
to initialize a set of related LTO themes.
## Not run:
# Initialize the LTO `demo` version of a classic The Twilight Zone (1959) story:
set_lto("demo")
story <- Story$new(story_id = "tz1959e1x22")
# Print story info and thematic annotations to console:
story
# Print story info and thematic annotations in st.txt format:
story$print(canonical = TRUE)
# Return the story title:
story$title()
# Return the story description:
story$description()
# Return a tibble of thematic annotations:
story$themes()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.