Script: Script R6 class

ScriptR Documentation

Script R6 class

Description

R6 class for storing information about a script and methods for analysing the text

Value

returns an R6 object of class Script

Public fields

path

The file path to the script

name

The title of the script/play

raw_text

The raw, unaltered text extracted from the file

text_df

The raw text, formatted as a dataframe with one row per line

search_results

A subset of text_df, filtered using the $search() method

Methods

Public methods


Method new()

Initialise a new Script object

Usage
Script$new(path, title)
Arguments
path

The file path to the script

title

(optional) the title of the script

Returns

an R6 object with class Script


Method print()

Print info about script

Usage
Script$print()

Method search()

Search for a string and return lines that match the string

Usage
Script$search(string)
Arguments
string

the string to search for

Returns

a subset of the text_df dataframe with matching lines


Method clone()

The objects of this class are cloneable with this method.

Usage
Script$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


chrisbrownlie/scriptSearch documentation built on Aug. 5, 2022, 10:04 p.m.