Learn R Programming

stoRy (version 0.1.5)

story: Story objects

Description

The stoRy package uses the story object to store story themes together with other metadata.

Arguments

Fields

Each story object has the following ten fields

story_id

A story ID. See examples.

title

A string giving the story title.

writer

A string giving the story writer.

director

A string giving the story director.

air_date

A string giving the story original air date in the for YYYY-MM-DD

summary

A string giving a summary of the story.

characters

A list of story characters. The list has three fields: ObjectCharacters, MajorCharacters, and MinorCharacters. Each list entry should be a ", " separated string of character names.

themes

A data frame of story themes with associated metadata.

settings

A data frame of story settings with associated metadata.

keywords

A data frame of story keywords with associated metadata.

Methods

Public methods

Method new()

Usage

story$new(
  story_id,
  title,
  writer,
  director,
  air_date,
  summary,
  characters,
  themes,
  settings,
  keywords
)

Method add_theme()

Usage

story$add_theme(
  theme,
  level,
  comment,
  related_cahracters,
  character_class,
  related_aliens,
  related_things
)

Method remove_theme()

Usage

story$remove_theme(theme)

Method add_setting()

Usage

story$add_setting(setting, capacity)

Method remove_setting()

Usage

story$remove_setting(setting)

Method add_keyword()

Usage

story$add_keyword(keyword, comment, timing, parent_keyword)

Method remove_keyword()

Usage

story$remove_keyword(keyword)

Method print()

Usage

story$print(...)

Method clone()

The objects of this class are cloneable with this method.

Usage

story$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

Run this code
# NOT RUN {
########################################################################
# Create a story object for the Star Trek The Original Series episode  #
# tos1x19 "The Arena" and manipulate it in various ways                #
########################################################################
story_id <- "tos1x19"
mystory <- story$new(story_id)
print(mystory)

########################################################################
# Add "neo-luddist utopia" as a central theme                          #
########################################################################
mystory$add_theme(theme = "neo-luddist utopia", level = "central")

########################################################################
# Remove "neo-luddist utopia" as a central theme                       #
########################################################################
mystory$remove_theme(theme = "neo-luddist utopia")

########################################################################
# Add "mountain" as a setting                                          #
########################################################################
mystory$add_setting(setting = "mountain")

########################################################################
# Add a new keyword                                                    #
######################################################################## 
mystory$add_keyword(keyword = "Captain Kirk is climbing a mountain")
# }

Run the code above in your browser using DataLab