as_conc: Coerce data frame to a concordance object

Description Usage Arguments Value Examples

Description

Coerces a data frame to an object of the class conc.

Usage

1
2
3
4
5
6
as_conc(x,
        left = NA,
        match = NA,
        right = NA,
        keep_original = FALSE,
        ...) 

Arguments

x

a data frame.

left

the name of the column in x that contains the left co-text of the concordance. Is is.na(left), then this column is assumed to have the name "left".

match

the name of the column in x that contains the match of the concordance. Is is.na(match), then this column is assumed to have the name "match".

right

the name of the column in x that contains the right co-text of the concordance. Is is.na(right), then this column is assumed to have the name "right".

keep_original

if any of the arguments left, match, or right has a non-NA value different from resp. "left", "match", or "right", and moreover keep_original is FALSE, then columns with those names are not kept in the output of as_conc.

...

any additional arguments.

Value

This function returns an object of the class "conc".

Examples

1
2
3
(conc_data <- conc_re('\\w+', 'A very small corpus.', as_text = TRUE))
df <- as.data.frame(conc_data)
as_conc(df)

wai-wong-reimagine/mclm documentation built on May 16, 2019, 9:12 p.m.