codeByRegex: Function codeByRegex

codeByRegexR Documentation

Function codeByRegex

Description

Adds code tags to certain passages of a character vector.

Usage

codeByRegex(corpus, passage, coding = "code", context = 0, mess = T,
  assign = F, subcorpus = NULL, partial = F, prepare = T)

Arguments

corpus

Character vector containing one document per element.

passage

Character element containing a regular expression that describes the passages that are to be coded.

coding

Character element containing the label of the code tag. Defaults to "code".

context

Numeric element specifying the context that is to be coded: 0 for coding only words, 2 for coding sentences, 3 for coding whole documents. Defaults to 0

mess

Logical element. If T (default) there will be a message containing the coded corpus.

assign

Logical element. If T the corpus will be saved in the global environment. Defaults to F.

subcorpus

Numeric vector specifying which documents of the corpus to code. If NULL (default) the whole corpus will be coded.

partial

Logical element specifying whether words that contain the passage (without being identical to it) should also be coded. Defaults to F.

prepare

Logical element specifying whether to exclude newline-characters from the corpus before coding. Defaults to T.

Details

Adds code tags to certain passages of a character vector.

Examples

codeByPassage("hello world hello world hello world hello world","hello","code1")

AndreasFischer1985/quantqual documentation built on June 20, 2022, 4:55 p.m.