wbs_create: Create a wbs object

Description Usage Arguments Details Value Examples

View source: R/wbs_tools.R

Description

wbs_create() is typically not called by itself by rather through as_wbs(). See wbs_check() for more details on wbs validity checks.
Returns the vector with appropriate class attributes. Type 'wbs' is not yet assigned.

Usage

1
wbs_create(x, sep = ".", width = NULL, .force = FALSE)

Arguments

x

Object to be coerced or tested.

sep

Not yet implemented. String to split wbs on. Default is ".". Will not be used if width is specified.

width

Not yet implemented. Integer width that defines a wbs level in the overall string. Overrides sep if a value is given. For example, "010101" may be given to represent 1.1.1. In this case, width = 2.

.force

Logical whether to create the wbs even if an invalid entry is detected.

Details

The following attributes are attached to the return vector.

levels

Number of levels the wbs goes down to.

Value

A character vector with attributes.

Examples

1
2
3
4
5
x <- wbs_create(c("1", "1.1", "1.1.1", "1.2"))

# notice the class is still character
class(x)
class(as_wbs(x))

Technomics/wbstools documentation built on Jan. 28, 2020, 7:10 a.m.