probe_colo__plot: Generate List of Exploration 'search_term' + 'frequent_terms'...

Description Usage Arguments Value Note See Also Examples

Description

probe_colo_plot_list - The task of determining the regexes used to feed a term_count object's term.list requires careful exploration of term use in context. This function generates a list of function calls for search_term + frequent_terms + plot with a user predefined data set and term list. This allows the user to use bar plot explorations to explore a list of terms (such as from frequent_terms) and the accompanying terms that frequently collocate with these terms.

probe_colo_plot - Make the plots of probe_colo_plot_list directly to an external ‘.pdf’ file.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
probe_colo_plot_list(
  terms,
  data.name,
  copy2clip = getOption("termco.copy2clip"),
  ldots = ""
)

probe_colo_plot(
  terms,
  data,
  file = sprintf("%scolo_term_plots.pdf", ifelse(dir.exists("plots/"), "plots", "")),
  width = 5.5,
  height = 7,
  ...
)

Arguments

terms

A vector of regex terms to explore (often populated from frequent_terms.

data.name

A character vector of a data set's name that will serve as the search context.

copy2clip

logical. If codeTRUE uses write_clip to copy the output to the clipboard. This option is most useful when trying to build a list regular expression model for easy pasting between testing a regex and putting it into the model. This argument can be set globally by setting options(termco.copy2clip = TRUE).

ldots

A string (starting with a comma) of additional arguments to include in the frequent_terms function of the list of function calls.

data

A vector of character strings.

file

A path for the ‘.pdf’ file to plot to.

width

The width of the graphics region in inches.

height

The height of the graphics region in inches.

...

Other arguments passed to frequent terms.

Value

Vprobe_colo_plot_list - Returns a string with the concatenated function calls. The print method separates the concatenated string into new line function calls. If copy2clip = TRUE the calls are easily pasted for use in exploration of the terms in the text data set.

Note

To actually make a ‘.pdf’ file of the plots use the probe_colo_plot function directly. Also note that probe_colo_plot_list takes a character name for data.name whereas probe_colo_plot takes a an actual vector object for data.

See Also

Other probe functions: probe_colo_list(), probe_list()

Other probe functions: probe_colo_list(), probe_list()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
probe_colo_plot_list(c("thank", "\\bthe", "ee"), "sam_i_am")
probe_colo_plot_list(
    c("thank", "\\bthe", "ee"),
    "sam_i_am",
    ldots = ", n = 10, min.char = 5"
)

txt <- presidential_debates_2012[["dialogue"]]
terms <- frequent_terms(txt)[["term"]]
probe_colo_plot_list(terms, "txt")

## Not run: 
probe_colo_list(terms, "txt", copy2clip = TRUE)

#make an external file of plots
probe_colo_plot(terms, txt)

## End(Not run)

trinker/termco documentation built on Jan. 7, 2022, 3:32 a.m.