update_klass | R Documentation |
Update multiple Klass codes to a desired date.
update_klass(
codes,
dates = NA,
classification = NULL,
date = NULL,
graph = klass_graph(classification, date),
output = "code",
report = FALSE,
combine = TRUE
)
codes |
Codes to be updated. |
dates |
Optional. Can be used to specify what date each of the codes was
valid in. Supply a character vector of either length 1 to specify the same
valid date for all codes, or of the same length as |
classification |
The ID of the desired classification. |
date |
Optional. Can be used to specify the date the codes should be
updated to, e.g. if you have codes that are valid in year |
graph |
Optional. A graph object generated by |
output |
Either a character vector, containing one or more of the items
in the list below, or
|
report |
|
combine |
|
If output = "code"
, a vector of length length(codes)
containing either a code if the update is successful or NA
if the
code has been split. If combine = FALSE
, a code being combined with
another code will also return NA
.
If output == TRUE
, a list of length length(codes)
containing
data.frame
s detailing the codes visited through the node search. The
tables have the following columns.
—
If report == TRUE
and length(output) > 1 | TRUE
, the result
will be a list of data.frame
s with number of rows equal to the
number of codes in the sequence of changes between the input codes and
output codes. The columns in the data.frame
s are specified with
output
.
If report == TRUE
and length(output) == 1
, the result will be
a list of character vectors 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 vectors is specified with output
.
If report == FALSE
and length(output) > 1 | TRUE
the result
will be a list of data.frame
s 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 containing information about the updated codes
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
.
library(klassR)
codes <- get_klass(131, date = "2020-01-01")[["code"]]
## Not run:
updated_codes <- update_klass(codes,
dates = "2020-01-01",
classification = 131
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.