Skip to contents

Replaces the name of a markovchain object (its name slot).

Usage

name(object) <- value

# S4 method for class 'markovchain'
name(object) <- value

Arguments

object

A markovchain object.

value

The new name, a character string.

Value

The object with the new name (used as name(object) <- value).

See also

name() to read it.

Author

Giorgio Spedicato, Deepak Yadav

Examples

statesNames <- c("a", "b", "c")
markovB <- new("markovchain", states = statesNames, transitionMatrix =
                matrix(c(0.2, 0.5, 0.3, 0, 1, 0, 0.1, 0.8, 0.1), nrow = 3,
                byrow = TRUE, dimnames=list(statesNames,statesNames)),
                name = "A markovchain Object" 
)
name(markovB) <- "dangerous mc"
name(markovB)
#> [1] "dangerous mc"