Learn R Programming

phylosim (version 3.0.5)

setState.Site: Set the state of a Site object

Description

Set the state of a Site object.

Usage

# S3 method for Site
setState(this, new.state, ...)

Arguments

this

A Site object.

new.state

A character vector of length one, containing a symbol belonging to the attached Alphabet object.

...

Not used.

Value

Returns the new state (invisible).

See Also

For more information see Site.

Examples

Run this code
# NOT RUN {
       # create a Site object with an Alphabet object attached
       s<-Site(alphabet=Alphabet(symbols=c(0,1)), state=1);
       # set a new state
       setState(s,"0")
       # get state via virtual field
       s$state
       # set a new state via virtual field
       s$state<-1
	s$state

 
# }

Run the code above in your browser using DataLab