orig_ranks {mclm}R Documentation

Retrieve or set original ranks

Description

These methods retrieve or set, for a the original ranks for the frequency counts of an object. These original ranks are only defined if x is the result of a selection procedure (i.e. if x contains frequency counts for a selection of items only, and not for all tokens in the corpus).

Usage

orig_ranks(x, ...)

orig_ranks(x) <- value

## S3 replacement method for class 'freqlist'
orig_ranks(x) <- value

## S3 method for class 'freqlist'
orig_ranks(x, with_names = FALSE, ...)

## Default S3 replacement method:
orig_ranks(x) <- value

Arguments

x

An object of any of the classes for which the method is implemented.

...

Additional arguments.

value

Currently it can only be NULL.

with_names

Logical. Whether or not the items in the output should be given names. If TRUE, then the names of the types in the frequency list are used as names.

Value

Either NULL or a numeric vector, representing the original ranks, with as its names the types to which these ranks apply.

See Also

Other getters and setters: n_tokens(), n_types(), ranks(), tot_n_tokens(), type_names()

Examples

x <- freqlist("The man and the mouse.",
              as_text = TRUE)
x
orig_ranks(x)
orig_ranks(x, with_names = TRUE)

y <- keep_types(x, c("man", "and"))
orig_ranks(y)
y

orig_ranks(y) <- NULL
y
orig_ranks(y)

tot_n_tokens(y) <- sum(y)
y

[Package mclm version 0.2.7 Index]