klass_node {klassR} | R Documentation |
Given a Klass graph, find the node corresponding to a code and (optionally) a date.
Description
Given a Klass graph, find the node corresponding to a code and (optionally) a date.
Usage
klass_node(graph, x, date = NA)
Arguments
graph |
A graph generated by |
x |
The code to search for. |
date |
Optional. The specific date the supplied code is valid in. |
Value
The node in the graph corresponding to the supplied code. If date is
not provided, the node with the most recent code is returned. If date is
provided, the code with date between validFrom
and validTo
is
returned.
Examples
# Build a graph directed towards the most recent codes.
library(klassR)
## Not run:
klass_131 <- klass_graph(131)
## End(Not run)
# Find the most recent node in the graph representing the code "0101" (Halden,
# valid to 2020.)
## Not run:
halden_node <- klass_node(klass_131, "0101")
## End(Not run)
[Package klassR version 1.0.2 Index]