
Show all coded fragments
Source:R/resultsOverview_allCodedFragments.R
resultsOverview_allCodedFragments.Rd
Show all coded fragments
Usage
resultsOverview_allCodedFragments(
x,
root = "codes",
context = 0,
heading = NULL,
headingLevel = 2,
add_html_tags = TRUE,
cleanUtterances = FALSE,
output = NULL,
outputViewer = "viewer",
template = "default",
includeCSS = TRUE,
includeBootstrap = rock::opts$get("includeBootstrap"),
preventOverwriting = rock::opts$get(preventOverwriting),
silent = rock::opts$get(silent)
)
Arguments
- x
The parsed source(s) as provided by
rock::parse_source
orrock::parse_sources
.- root
The root code
- context
How many utterances before and after the target utterances to include in the fragments. If two values, the first is the number of utterances before, and the second, the number of utterances after the target utterances.
- heading
Optionally, a title to include in the output. The title will be prefixed with
headingLevel
hashes (#
), and the codes withheadingLevel+1
hashes. IfNULL
(the default), a heading will be generated that includes the collected codes if those are five or less. If a character value is specified, that will be used. To omit a heading, set to anything that is notNULL
or a character vector (e.g.FALSE
). If no heading is used, the code prefix will beheadingLevel
hashes, instead ofheadingLevel+1
hashes.- headingLevel
The number of hashes to insert before the headings.
Whether to add HTML tags to the result.
- cleanUtterances
Whether to use the clean or the raw utterances when constructing the fragments (the raw versions contain all codes). Note that this should be set to
FALSE
to haveadd_html_tags
be of the most use.- output
Here, a path and filename can be provided where the result will be written. If provided, the result will be returned invisibly.
- outputViewer
If showing output, where to show the output: in the console (
outputViewer='console'
) or in the viewer (outputViewer='viewer'
), e.g. the RStudio viewer. You'll usually want the latter when outputting HTML, and otherwise the former. Set toFALSE
to not output anything to the console or the viewer.- template
The template to load; either the name of one of the ROCK templates (currently, only 'default' is available), or the path and filename of a CSS file.
- includeCSS
Whether to include the ROCK CSS in the returned HTML.
- includeBootstrap
Whether to include the default bootstrap CSS.
- preventOverwriting
Whether to prevent overwriting of output files.
- silent
Whether to provide (
FALSE
) or suppress (TRUE
) more detailed progress updates.
Examples
### Get path to example source
examplePath <-
system.file("extdata", package="rock");
### Get a path to one example file
exampleFile <-
file.path(
examplePath, "example-1.rock"
);
### Parse single example source
parsedExample <-
rock::parse_source(
exampleFile
);
### Show organised coded fragments in Markdown
cat(
rock::resultsOverview_allCodedFragments(
parsedExample
)
);
#>
#>
#> ### Code: `parentCode1`
#>
#>
#>
#> #### Code: `childCode1`
#>
#>
#>
#> #### Collected coded fragments for codes 'childCode1' with a total of 0 lines of context (0+0)
#>
#>
#>
#> ##### childCode1 *(path: childCode1)*
#>
#>
#>
#> -----
#>
#> Lorem Ipsum is simply dummy text of the printing and typesetting industry. [[parentCode1>childCode1]]
#>
#> -----
#>
#> ~specimen book. [[parentCode1>childCode2]] [[childCode1]] [[intensity||2]]
#>
#> -----
#>
#>
#>
#> ##### Code: `grandchildCode1`
#>
#>
#>
#> ##### Collected coded fragments for codes 'grandchildCode1' with a total of 0 lines of context (0+0)
#>
#>
#>
#> ###### grandchildCode1 *(path: parentCode1>childCode1>grandchildCode1)*
#>
#>
#>
#> -----
#>
#> using 'Content here, content here', making it look like readable English. [[parentCode1>childCode1>grandchildCode1]]
#>
#> -----
#>
#>
#>
#> ##### Code: `grandchildCode2`
#>
#>
#>
#> ##### Collected coded fragments for codes 'grandchildCode2' with a total of 0 lines of context (0+0)
#>
#>
#>
#> ###### grandchildCode2 *(path: childCode1>grandchildCode2)*
#>
#>
#>
#> -----
#>
#> ~still in their infancy. [[parentCode1>childCode1>grandchildCode2]]
#>
#> -----
#>
#> accompanied by English versions from the 1914 translation by H. Rackham. [[childCode1>grandchildCode2]]
#>
#> -----
#>
#> reasonable. The generated Lorem Ipsum is therefore always free from [[grandchildCode2]]
#>
#> -----
#>
#>
#>
#> ##### Code: `grandchildCode3`
#>
#>
#>
#> ##### Collected coded fragments for codes 'grandchildCode3' with a total of 0 lines of context (0+0)
#>
#>
#>
#> ###### grandchildCode3 *(path: parentCode1>childCode1>grandchildCode3)*
#>
#>
#>
#> -----
#>
#> by accident, sometimes on purpose (injected humour and the like). [[parentCode1>childCode1>grandchildCode3]]
#>
#> -----
#>
#>
#>
#> #### Code: `childCode2`
#>
#>
#>
#> #### Collected coded fragments for codes 'childCode2' with a total of 0 lines of context (0+0)
#>
#>
#>
#> ##### childCode2 *(path: parentCode1>childCode2)*
#>
#>
#>
#> -----
#>
#> ~specimen book. [[parentCode1>childCode2]] [[childCode1]] [[intensity||2]]
#>
#> -----
#>
#>
#>
#> #### Code: `childCode3`
#>
#>
#>
#> #### Collected coded fragments for codes 'childCode3' with a total of 0 lines of context (0+0)
#>
#>
#>
#> ##### childCode3 *(path: parentCode1>childCode3)*
#>
#>
#>
#> -----
#>
#> ~~electronic typesetting, remaining essentially unchanged. [[parentCode1>childCode3]] [[someOtherCode]]
#>
#> -----
#>
#>
#>
#> ### Code: `parentCode2`
#>
#>
#>
#> #### Code: `childCode4`
#>
#>
#>
#> #### Collected coded fragments for codes 'childCode4' with a total of 0 lines of context (0+0)
#>
#>
#>
#> ##### childCode4 *(path: parentCode2>childCode4)*
#>
#>
#>
#> -----
#>
#> ~~including versions of Lorem Ipsum. [[parentCode2>childCode4]]
#>
#> -----
#>
#>
#>
#> ##### Code: `grandchildCode4`
#>
#>
#>
#> ##### Collected coded fragments for codes 'grandchildCode4' with a total of 0 lines of context (0+0)
#>
#>
#>
#> ###### grandchildCode4 *(path: parentCode2>childCode4>grandchildCode4)*
#>
#>
#>
#> -----
#>
#> Where does it come from? [[parentCode2>childCode4>grandchildCode4]]
#>
#> -----
#>
#>
#>
#> ##### Code: `grandchildCode5`
#>
#>
#>
#> ##### Collected coded fragments for codes 'grandchildCode5' with a total of 0 lines of context (0+0)
#>
#>
#>
#> ###### grandchildCode5 *(path: parentCode2>childCode4>grandchildCode5)*
#>
#>
#>
#> -----
#>
#> old. [[parentCode2>childCode4>grandchildCode5]]
#>
#> -----
#>
#>
#>
#> ##### Code: `grandchildCode6`
#>
#>
#>
#> ##### Collected coded fragments for codes 'grandchildCode6' with a total of 0 lines of context (0+0)
#>
#>
#>
#> ###### grandchildCode6 *(path: parentCode2>childCode4>grandchildCode6)*
#>
#>
#>
#> -----
#>
#> discovered the undoubtable source. [[parentCode2>childCode4>grandchildCode6]]
#>
#> -----
#>
#>
#>
#> #### Code: `childCode5`
#>
#>
#>
#> #### Collected coded fragments for codes 'childCode5' with a total of 0 lines of context (0+0)
#>
#>
#>
#> ##### childCode5 *(path: parentCode2>childCode5)*
#>
#>
#>
#> -----
#>
#> content of a page when looking at its layout. [[parentCode2>childCode5]]
#>
#> -----
#>
#>
#>
#> ##### Code: `grandchildCode7`
#>
#>
#>
#> ##### Collected coded fragments for codes 'grandchildCode7' with a total of 0 lines of context (0+0)
#>
#>
#>
#> ###### grandchildCode7 *(path: childCode5>grandchildCode7)*
#>
#>
#>
#> -----
#>
#> repetition, injected humour, or non-characteristic words etc. [[childCode5>grandchildCode7]]
#>
#> -----
#>
#>
#>
#> ### Code: `someOtherCode`
#>
#>
#>
#> ### Collected coded fragments for codes 'someOtherCode' with a total of 0 lines of context (0+0)
#>
#>
#>
#> #### someOtherCode *(path: someOtherCode)*
#>
#>
#>
#> -----
#>
#> ~~electronic typesetting, remaining essentially unchanged. [[parentCode1>childCode3]] [[someOtherCode]]
#>
#> -----
#>