minmax {lfl} | R Documentation |
Creating linguistic context directly from values
Description
This function creates a context (i.e. an instance of S3 class
ctx3()
, ctx3bilat()
, ctx5()
, or ctx5bilat()
) based on values
of the numeric vector x
. In default, the context is based on minimum
and maximum value of x
in the following way:
-
ctx3
,ctx5
: low = minimum, high = maximum value ofx
; -
ctx3bilat
,ctx5bilat
: negMax = minimum, max = maximum value ofx
, origin = mean of minimum and maximum.
Usage
minmax(x, type = c("ctx3", "ctx5", "ctx3bilat", "ctx5bilat"), ...)
Arguments
x |
A numeric vector to compute the context from |
type |
A type of the context to be returned. Must be one of:
|
... |
other parameters to be passed to the appropriate constructor
( |
Details
Other values are computed accordingly to defaults as defined in the constructors
ctx3()
, ctx3bilat()
, ctx5()
, and ctx5bilat()
).
Examples
minmax(0:100) # returns ctx3: 0, 50, 100
minmax(0:100, high=80) # returns ctx3: 0, 40, 80
minmax(0:100, relCenter=0.4) # returns ctx3: 0, 40, 100
minmax(0:100, type='ctx5') # returns ctx5: 0, 25, 50, 75, 100