update_code: Update a code found in a directed graph based on a...

View source: R/UpdateKlass.R

update_codeR Documentation

Update a code found in a directed graph based on a Klass-classification

Description

Update a code found in a directed graph based on a Klass-classification

Usage

update_code(
  graph,
  code,
  date = NA,
  output = "code",
  combine = TRUE,
  report = FALSE
)

Arguments

graph

A graph generated by klass_graph.

code

A Klass code

date

Optional. The specific date the supplied code is valid in.

output

Either a character vector, containing one or more of the items in the list below, or TRUE to include all columns.

"code"

The Klass code.

"name"

The Klass name.

"validFrom"

The date that the code is valid from.

"validTo"

The date that the code is valid to.

"split"

Logical: Does the code split into two or more codes?

"combined"

Logical: Does two or more codes become this code?

"nextCode"

If split == FALSE, gives the code this code changed into. NA otherwise.

combine

TRUE or FALSE. See the return section.

report

TRUE or FALSE. See the return section.

Value

If report == TRUE and length(output) > 1 | TRUE, the result will be a data.frame with number of rows equal to the number of codes in the sequence of changes between the input code and output code. The columns in the data.frame are specified with output.

If report == TRUE and length(output) == 1, the result will be a character vector with length equal to the number of codes in the sequence of changes between the input code and output code. The contents of the character vector is specified with output.

If report == FALSE and length(output) > 1 | TRUE the result will be a data.frame with one row representing the last code in the change sequence and columns specified by output. If a code has been split, the result will be NA. If combine == FALSE and a code is the result of a combination of codes, the result will be NA.

If report == FALSE and length(output) == 1, the result will be a character vector of length one, containing information about the updated code specified by output. If a code has been split, the result will be NA. If combine == FALSE and a code is the result of a combination of codes, the result will be NA.

See Also

See [update_klass] for updating multiple codes in one function call.


klassR documentation built on April 4, 2025, 4:16 a.m.

Related to update_code in klassR...