From 57d88e37a0a0ad925c6b227cf672a8dc3a3cbd1d Mon Sep 17 00:00:00 2001 From: Jentoft Date: Fri, 15 Nov 2024 10:47:49 +0100 Subject: [PATCH] Wrapped slow examples in dontrun. --- R/UpdateKlass-graph-build.R | 8 +++++--- R/UpdateKlass-graph-navigate.R | 11 ++++++----- R/UpdateKlass.R | 2 ++ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/R/UpdateKlass-graph-build.R b/R/UpdateKlass-graph-build.R index 50850af..2dc0c1a 100644 --- a/R/UpdateKlass-graph-build.R +++ b/R/UpdateKlass-graph-build.R @@ -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.") diff --git a/R/UpdateKlass-graph-navigate.R b/R/UpdateKlass-graph-navigate.R index 433937e..ebf29bb 100644 --- a/R/UpdateKlass-graph-navigate.R +++ b/R/UpdateKlass-graph-navigate.R @@ -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]]) @@ -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( diff --git a/R/UpdateKlass.R b/R/UpdateKlass.R index 628278c..49ddc22 100644 --- a/R/UpdateKlass.R +++ b/R/UpdateKlass.R @@ -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,