setProbs.DiscreteInsertor: Set the insertion length probabilities

Description Usage Arguments Value Author(s) See Also Examples

Description

Set the insertion length probabilities.

The sizes virtual field must be set before setting the length probabilities. The length of the provided numeric vector must match with the length of the vector stored in the sizes virtual field. The vector is rescaled if the values do not sum to one and a warning is issued.

Usage

1
2
## S3 method for class 'DiscreteInsertor'
setProbs(this, value, ...)

Arguments

this

A DiscreteInsertor object.

value

A numeric vector containg the length probabilities.

...

Not used.

Value

The vector of probabilities.

Author(s)

Botond Sipos, Gregory Jordan

See Also

For more information see DiscreteInsertor.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
       # create a DiscreteInsertor object
       i<-DiscreteInsertor(rate=1, sizes=1:3)
       # set/get length probabilities
       setProbs(i,c(1/3,1/3,1/3)) # equal probabilites
       getProbs(i)
       # set/get length probabilities via virtual field
       x<-c(2,2,1)
       # normalize x
       x<-x/sum(x)
       i$probs<-x
       i$probs
 

phylosim documentation built on May 19, 2017, 1:06 p.m.

Search within the phylosim package
Search all R packages, documentation and source code