These function parse one (parse_source
) or more (parse_sources
) sources and the
contained identifiers, sections, and codes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | parse_source(text, file, codeRegexes = c(code =
"\\[\\[([a-zA-Z0-9._>-]+)\\]\\]"), idRegexes = c(caseId =
"\\[\\[cid=([a-zA-Z0-9._-]+)\\]\\]", stanzaId =
"\\[\\[sid=([a-zA-Z0-9._-]+)\\]\\]"),
sectionRegexes = c(paragraphs = "---paragraph-break---", secondary =
"---<[a-zA-Z0-9]?>---"), autoGenerateIds = c("stanzaId"),
persistentIds = c("caseId"), inductiveCodingHierarchyMarker = ">",
metadataContainers = c("metadata"), codesContainers = c("codes",
"dct"), delimiterRegEx = "^---$", ignoreRegex = "^#",
ignoreOddDelimiters = FALSE, encoding = "UTF-8", silent = FALSE)
## S3 method for class 'rockParsedSource'
print(x, prefix = "### ", ...)
parse_sources(path, extension = "rock|dct", regex, recursive = TRUE,
codeRegexes = c(code = "\\[\\[([a-zA-Z0-9._>-]+)\\]\\]"),
idRegexes = c(caseId = "\\[\\[cid=([a-zA-Z0-9._-]+)\\]\\]",
stanzaId = "\\[\\[sid=([a-zA-Z0-9._-]+)\\]\\]"),
autoGenerateIds = c("stanzaId"), sectionRegexes = c(paragraphs =
"---paragraph-break---", secondary = "---<[a-zA-Z0-9]?>---"),
inductiveCodingHierarchyMarker = ">", delimiterRegEx = "^---$",
metadataContainers = c("metadata"), codesContainers = c("codes",
"dct"), ignoreRegex = "^#", ignoreOddDelimiters = FALSE,
encoding = "UTF-8", silent = TRUE)
## S3 method for class 'rockParsedSources'
print(x, prefix = "### ", ...)
## S3 method for class 'rockParsedSources'
plot(x, ...)
|
text, file |
As |
codeRegexes, idRegexes, sectionRegexes |
These are named character vectors with one
or more regular expressions. For |
autoGenerateIds |
The names of the |
persistentIds |
The names of the |
inductiveCodingHierarchyMarker |
For inductive coding, this marker is used to indicate
hierarchical relationships between codes. The code at the left hand side of this marker will
be considered the parent code of the code on the right hand side. More than two levels
can be specified in one code (for example, if the |
metadataContainers |
The name of YAML fragments containing metadata (i.e. attributes about cases). |
codesContainers |
The name of YAML fragments containing (parts of) deductive coding trees. |
delimiterRegEx |
The regular expression that is used to extract the YAML fragments. |
ignoreRegex |
The regular expression that is used to delete lines before any other processing. This can be used to enable adding comments to sources, which are then ignored during analysis. |
ignoreOddDelimiters |
If an odd number of YAML delimiters is encountered, whether this
should result in an error ( |
encoding |
The encoding of the file to read (in |
silent |
Whether to provide ( |
x |
The object to print. |
prefix |
The prefix to use before the 'headings' of the printed result. |
... |
Any additional arguments are passed on to the default print method. |
path |
The path containing the files to read. |
extension |
The extension of the files to read; files with other extensions will
be ignored. Multiple extensions can be separated by a pipe ( |
regex |
Instead of specifing an extension, it's also possible to specify a regular
expression; only files matching this regular expression are read. If specified, |
recursive |
Whether to also process subdirectories ( |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.