Skip to content

Commit

Permalink
Wrapped slow examples in dontrun.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jentoft committed Nov 15, 2024
1 parent c4fd887 commit 57d88e3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
8 changes: 5 additions & 3 deletions R/UpdateKlass-graph-build.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@ get_klass_changes <- function(classification) {
#' library(klassR)
#'
#' # Build a graph directed towards the most recent codes
#'
#' \dontrun{
#' klass_131 <- klass_graph(131)
#' }
#'
#' # Build a graph directed towards valid codes in 2020.
#'
#' \dontrun{
#' klass_131_2020 <- klass_graph(131, "2020-01-01")
#'
#' }
#'
klass_graph <- function(classification, date = NULL) {
if (is.null(classification)) stop("Please provide a classification ID.")

Expand Down
11 changes: 6 additions & 5 deletions R/UpdateKlass-graph-navigate.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
#'
#' # Build a graph directed towards the most recent codes.
#' library(klassR)
#' \dontrun{
#' klass_131 <- klass_graph(131)
#' }
#'
#' # Find the most recent node in the graph representing the code "0101" (Halden,
#' # valid to 2020.)
#'
#' \dontrun{
#' halden_node <- klass_node(klass_131, "0101")
#'
#' }
klass_node <- function(graph, x, date = NA) {
if (!is.na(date)) {
date <- as.Date(date[[1]])
Expand Down Expand Up @@ -154,12 +156,11 @@ is_combined <- function(graph, node, compare_node = NULL) {
#'
#' # Find the most recent node in the graph representing the code "0101" (Halden,
#' # valid to 2020.)
#'
#' halden_node <- klass_node(klass_131, "0101")
#'
#'
#' # Find the most recent code corresponding to 0101 Halden
#'
#' halden_node_updated <- update_klass_node(klass_131, halden_node)
#'
#'
update_klass_node <- function(graph, node) {
bfs_result <- igraph::bfs(
Expand Down
2 changes: 2 additions & 0 deletions R/UpdateKlass.R
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,12 @@ update_code <- function(graph,
#' library(klassR)
#' codes <- get_klass(131, date = "2020-01-01")[["code"]]
#'
#' \dontrun{
#' updated_codes <- update_klass(codes,
#' dates = "2020-01-01",
#' classification = 131
#' )
#' }
#'
update_klass <- function(codes,
dates = NA,
Expand Down

0 comments on commit 57d88e3

Please sign in to comment.