cqp_flist: Create a frequency list

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

View source: R/s3.R

Description

Create a frequency list on any phenomenon available in a CWB corpus: frequency of forms of a positional attribute, frequency of a value of a structural attribute, or frequency of forms found in an anchor (match, matchend, target, keyword) of a subcorpus.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
cqp_flist(x, ...)

 ## S3 method for class 'cqp_attr'
cqp_flist(x, cutoff = 0, ...)
 
 ## S3 method for class 'cqp_corpus'
cqp_flist(x, attribute, cutoff = 0, ...)
 
 ## S3 method for class 'cqp_subcorpus'
cqp_flist(x, anchor, attribute, left.context = 0, 
        right.context = 0, cutoff = 0, offset = 0, ...)

Arguments

x

An attribute, a corpus or a subcorpus object, created with the function corpus or subcorpus.

attribute

The attribute giving the modality to be counted. May be a structural attribute if x is a corpus.

anchor

Where to count the modality : on the match, matchend, target or keyword anchor of a subcorpus.

left.context

Consider also n tokens on the left of the selected anchor for counting frequencies.

right.context

Consider also n tokens on the right of the selected anchor for counting frequencies.

offset

Switch the anchor at n tokens from the left (if negative) or to the right of the anchor given above.

cutoff

Keep only frequencies above this cutoff. If cutoff is 0, keep all forms. If cutoff is between 0 and 1 (exclusive), the (cutoff * 100) % more frequent forms are kept.

...

Ignored.

Value

Returns a named numeric vector.

Author(s)

Bernard Desgraupes - bernard.desgraupes@u-paris10.fr - University Paris-10.
Sylvain Loiseau - sylvain.loiseau@univ-paris13.fr - University Paris-13.

References

http://cwb.sourceforge.net/documentation.php

See Also

cqp_ftable, cqp_kwic, subcorpus, corpus.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
c <- corpus("DICKENS");
fl <- cqp_flist(c, "word");

sc <- subcorpus(c, '"interesting" "to" @ []');
fl <- cqp_flist(sc, "target", "word");

sc <- subcorpus(c, '"interesting"');
fl <- cqp_flist(sc, "target", "lemma", left.context = 10, right.context = 10, cutoff = 5)

## End(Not run)

rcqp documentation built on March 18, 2018, 1:54 p.m.