codingBySearch: Auto-coding by pattern matching

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/autoCoding.R

Description

Applies the specified code to a specified file based on given text pattern.

Usage

1
2
codingBySearch(pattern, fid = getFileIds(), cid, seperator="\n",
               concatenate = FALSE, ...)

Arguments

pattern

a text string, to be matched to the text in the RQDA project file

fid

File id, in the GUI 'File' tab click on file to see its id

cid

Code id, in the GUI 'Codes' tab click on code to see its id

seperator

single character string, specifying the separator of unit of analysis.

concatenate

a boolean value, if TRUE then matches in adjacent units (ie only separated by 'seperator') are fused into a single coding.

...

arguments passed to gregexpr.

A useful example is the 'ignore.case' argument.

Details

The function can be used if one is interested in automatically applying a code to paragraphs in a file based on certain words specified by 'pattern'.

It first splits the whole text into pieces which depend on the separator, then matches the pattern with each pieces. When a match is found, the piece is coded to the code specified by cid. The default separator defines paragraph as unit of analysis. The separator is passed to the pattern argument of gregexpr.

This function is also useful for keyword in context (KWIC) analysis.

Value

The function is used for its side effect.

Author(s)

Ronggui Huang

See Also

getFileIds

Examples

1
2
3
4
5
6
7
8
## Not run: 
codingBySearch("internet",fid=1,cid=2)

codingBySearch("internet",fid=getFileIds(),cid=2)

codingBySearch("internet",fid=getFileIds(),cid=2, seperator="[.!?]")

## End(Not run)

RQDA documentation built on May 2, 2019, 3:24 p.m.