stndnaming: Standard renaming of stages

View source: R/1b-base-model-function.R

stndnamingR Documentation

Standard renaming of stages

Description

Rename all stages in a staged event tree.

Usage

stndnaming(
  object,
  uniq = FALSE,
  prefix = FALSE,
  ignore = object$name_unobserved
)

Arguments

object

an object of class sevt.

uniq

logical, if stage numbers should be unique over all tree.

prefix

logical, if stage names should be prefixed with variable name.

ignore

vector of stages which will be ignored and left untouched, by default the name of the unobserved stages stored in object$name_unobserved.

Value

a staged event tree object with stages named with consecutive integers.

Examples

model <- stages_fbhc(full(PhDArticles, join_unobserved = TRUE))
model$stages
model1 <- stndnaming(model)
model1$stages

### unique stage names in all tree
model2 <- stndnaming(model, uniq = TRUE)
model2$stages

### prefix stage names with variable name 
model3 <- stndnaming(model, prefix = TRUE)
model3$stages

### manuallty select stage names left untouched
model4 <- stndnaming(model, ignore = c("2", "6"), prefix = TRUE)
model4$stages

stagedtrees documentation built on April 29, 2022, 1:06 a.m.