The make.mtkFactor function

Description

Creates a new input factor and specifies its uncertainty distribution.

Usage

1
2
3
make.mtkFactor(name="unkown", id="unkown", unit="", type="",
		 nominal=NA, distribName='unknown', distribPara=list(), features=list())
	 

Arguments

name

the name of the input factor.

id

the name of the factor in the simulation code, if different from name (optional).

unit

the measurement unit of the factor values (optional). This can be used in graphics or reports, for example.

type

the data-type of the factor's values (optional).

nominal

the nominal value of the factor.

distribName

the name of the probability distribution describing the factor's uncertainty.

distribPara

the list of distribution parameters.

features

the list of factor's features.

Details

The distribName argument must use the R terminology, for example norm for the normal distribution or unif for the uniform one; see help(distributions).

Value

an object of class mtkFactor.

Author(s)

Juhui WANG, MIA-jouy, INRA, Hervé Richard, BioSP, Inra, Herve.Richard@avignon.inra.fr, Hervé Monod

Examples

1
2
3
4
5
6
7
8
# Define a new continuous factor 
	make.mtkFactor("A", distribName="unif", distribPara=list(min=0,max=1))
# Define a new discrete factor 
	make.mtkFactor("D", distribName="discrete", distribPara =
				list(type='categorical', levels=c('a','b','c'), 
				weights=rep(0.33,3))
				)
	

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.