Description Usage Arguments Value Author(s) Examples
Sets new levels to a discrete distribution.
1 |
this |
an object of the class |
levels |
an object of the class |
invisible
Juhui WANG, MIA-jouy, INRA
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # Create a new mtkLevels for a discrete distribution
l <- mtkLevels(type='categorical', levels = c(1,2,3,4,5), weights=rep(0.2, 5))
# Change the levels'name to ('a','b','c','d','e')
setLevels(l, c('a','b','c','d','e'))
# Create a new domain with a discrete distribution
d <- mtkDomain(distributionName="discrete", domainNominalValue=3,
distributionParameters = list(type='categorical',
levels = c(1,2,3,4,5), weights=rep(0.2, 5)))
# Create a new mtkLevels for a discrete distribution and assign it to the domain
l <- mtkLevels(type='categorical', levels = c('a','b','c','d','e'), weights=rep(0.2, 5))
setLevels(d, l)
# Change the domain's levels to type='categorical', levels = c(5,4,3,2,1), weights=rep(0.2, 5)
setLevels(d, levels=list(type='categorical', levels = c(5,4,3,2,1), weights=rep(0.2, 5)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.