Learn R Programming

mtk (version 1.0)

mtkLevels-class: The mtkLevels class

Description

The mtkLevels class is a class used to manage the weighting levels associated with a factor's domain.

Arguments

Class Hierarchy

Parent classes :
Direct Known Subclasses :

Constructor

mtkLevesl
signature(type = "categorical", levels=vector(), weights=numeric(0))

Slots

type:
(character) a string to give the type of the discrete distribution such as 'categorical', 'qualitative', etc.
levels:
(vector) a vector to specify the levels.
weights:
(numeric) a numeric vector used to weight the levels.

Methods

getType
signature(this = "mtkLevels"): Returns the type of the discrete distribution such as 'categorical', 'qualitative', etc .
setType
signature(this = "mtkLevels", type="character"): Assigns a new type to the underlying object.
getLevels
signature(this = "mtkLevels"): Returns the vector of the levels.
setLevels
signature(this = "mtkLevels", levels = "vector"): Assigns a new vector to the levels.
getWeights
signature(this = "mtkLevels"): Returns the vector of the weights.
setWeights
signature(this = "mtkLevels", weights = "numeric"): Assigns new vector to the weight.
print
signature(x = "mtkLevel"): Prints a summarized report about the underlying object of the class mtkLevels.
summary
signature(object = "mtkLevel"): Gives a summary about the underlying object.
show
signature(object = "mtkLevel"): Displays informations about the underlying object.

Examples

Run this code
# Create an object of the class 'mtkLevels'

	l <- mtkLevels(type='categorical', levels=seq(1:3), weight=rep(0.33, 3))

# Set the levels'name to ('a', 'b', 'c')
	
	setLevels(l, levels=c('a', 'b', 'c'))

Run the code above in your browser using DataLab