makeEnc: Function for "equiprobabilistic" encoding of numerical...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/clamix12_05.R

Description

Prints out "equiprobabilistic" encodings (categorization) for numerical variables.

Usage

1
makeEnc(var, name, k, file="")

Arguments

var

variable values

name

name of variable

k

number of categories

file

file to write encoding into, default "" - to std. output

Value

The encoding is printed out and is to be used with encodeSO function for encoding numerical variables into variables suitable for symObject.

Author(s)

Vladimir Batagelj

See Also

encodeSO, create.symData, symObject

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
set.seed(42)
makeEnc(runif(100),"Rand",10)
# result - a LIST ():
#encRand <- list(
#  "[0]" = function(x) x<=0,
#  "(0,0.08998052]" = function(x) x<=0.08998052,
#  "(0.08998052,0.2163854]" = function(x) x<=0.2163855,
#  "(0.2163854,0.3590283]" = function(x) x<=0.3590284,
#  "(0.3590283,0.4749971]" = function(x) x<=0.4749972,
#  "(0.4749971,0.6117786]" = function(x) x<=0.6117787,
#  "(0.6117786,0.6932048]" = function(x) x<=0.6932049,
#  "(0.6932048,0.7846928]" = function(x) x<=0.7846929,
#  "(0.7846928,0.914806]" = function(x) x<=0.9148061,
#  "(0.914806,0.9888917]" = function(x) x<=0.9888918,
#  "NA" = function(x) TRUE )

clamix documentation built on May 2, 2019, 4:51 p.m.