From d53931584f0ba681ff8a069450cc10dfac3e57d1 Mon Sep 17 00:00:00 2001 From: Martin Chan Date: Thu, 17 Aug 2023 09:49:20 +0100 Subject: [PATCH] refactor: Move long-running examples under donttest examples in question were taking too long to run during package checks, causing warnings to be generated. By moving them under `donttest`, they will be excluded from the package checks while still being included in the package documentation. --- R/collaboration_area.R | 2 ++ R/external_network_plot.R | 2 +- R/flex_index.R | 4 ++++ R/internal_network_plot.R | 4 ++-- R/keymetrics_scan.R | 2 ++ R/meeting_quality.R | 4 ++++ R/personas_hclust.R | 2 ++ R/workpatterns_area.R | 4 ++++ man/collaboration_area.Rd | 2 ++ man/external_network_plot.Rd | 2 +- man/flex_index.Rd | 4 ++++ man/internal_network_plot.Rd | 4 ++-- man/keymetrics_scan.Rd | 2 ++ man/meeting_quality.Rd | 4 ++++ man/personas_hclust.Rd | 2 ++ man/workpatterns_area.Rd | 4 ++++ 16 files changed, 42 insertions(+), 6 deletions(-) diff --git a/R/collaboration_area.R b/R/collaboration_area.R index cb35ecda..54c449e1 100644 --- a/R/collaboration_area.R +++ b/R/collaboration_area.R @@ -45,7 +45,9 @@ #' collaboration_area(sq_data, hrvar = "Organization") #' #' # Return summary table +#' \donttest{ #' collaboration_area(sq_data, return = "table") +#' } #' #' @return #' A different output is returned depending on the value passed to the `return` argument: diff --git a/R/external_network_plot.R b/R/external_network_plot.R index b2631543..5cc26b0f 100644 --- a/R/external_network_plot.R +++ b/R/external_network_plot.R @@ -17,7 +17,7 @@ #' #' @examples #' # Return plot -#' sq_data %>% external_network_plot(return = "plot") +#' external_network_plot(sq_data, return = "plot") #' #' @return #' 'ggplot' object showing a bubble plot with external network size as the diff --git a/R/flex_index.R b/R/flex_index.R index fe289d90..ed358ae8 100644 --- a/R/flex_index.R +++ b/R/flex_index.R @@ -131,12 +131,16 @@ #' flex_index(return = "plot", plot_method = "common") #' #' # Plot Flexibility Index over time +#' \donttest{ #' em_data %>% #' flex_index(return = "plot", plot_method = "time") +#' } #' #' # Return a summary table with the computed Flexibility Index +#' \donttest{ #' em_data %>% #' flex_index(hrvar = "Organization", return = "table") +#' } #' #' @section Returning the raw data: #' The raw data containing the computed Flexibility Index can be returned with diff --git a/R/internal_network_plot.R b/R/internal_network_plot.R index c498a59a..83390cf6 100644 --- a/R/internal_network_plot.R +++ b/R/internal_network_plot.R @@ -18,10 +18,10 @@ #' #' @examples #' # Return plot -#' sq_data %>% internal_network_plot(return = "plot") +#' internal_network_plot(sq_data, return = "plot") #' #' # Return summary table -#' sq_data %>% internal_network_plot(return = "table") +#' internal_network_plot(sq_data, return = "table") #' #' @family Visualization #' @family Network diff --git a/R/keymetrics_scan.R b/R/keymetrics_scan.R index d00d0ae1..d7aca3d8 100644 --- a/R/keymetrics_scan.R +++ b/R/keymetrics_scan.R @@ -40,7 +40,9 @@ #' keymetrics_scan(sq_data, low = "purple", high = "yellow") #' #' # Return summary table +#' \donttest{ #' keymetrics_scan(sq_data, hrvar = "LevelDesignation", return = "table") +#' } #' #' @export diff --git a/R/meeting_quality.R b/R/meeting_quality.R index cac508e8..6131ad93 100644 --- a/R/meeting_quality.R +++ b/R/meeting_quality.R @@ -33,12 +33,16 @@ #' meeting_quality(sq_data, return = "plot") #' #' # Return plot - showing multi-tasking % +#' \donttest{ #' meeting_quality(sq_data, #' metric_x = "Multitasking_meeting_hours", #' return = "plot") +#' } #' #' # Return summary table +#' \donttest{ #' meeting_quality(sq_data, return = "table") +#' } #' #' @export diff --git a/R/personas_hclust.R b/R/personas_hclust.R index a0cef863..7c58eced 100644 --- a/R/personas_hclust.R +++ b/R/personas_hclust.R @@ -55,10 +55,12 @@ #' k = 4) #' #' # Return summary table +#' \donttest{ #' personas_hclust(sq_data, #' metrics = c("Collaboration_hours", "Workweek_span"), #' k = 4, #' return = "table") +#' } #' #' \donttest{ #' # Return data with clusters appended diff --git a/R/workpatterns_area.R b/R/workpatterns_area.R index 4bfd1fde..27db9fa0 100644 --- a/R/workpatterns_area.R +++ b/R/workpatterns_area.R @@ -68,10 +68,14 @@ #' workpatterns_area(em_data, return = "plot", values = "percent") #' #' # Return visualization of absolute values +#' \dontest{ #' workpatterns_area(em_data, return = "plot", values = "abs") +#' } #' #' # Return summary table +#' \donttest{ #' workpatterns_area(em_data, return = "table") +#' } #' #' @family Working Patterns #' diff --git a/man/collaboration_area.Rd b/man/collaboration_area.Rd index 1522879e..fc605861 100644 --- a/man/collaboration_area.Rd +++ b/man/collaboration_area.Rd @@ -54,7 +54,9 @@ collaboration_area(sq_data) collaboration_area(sq_data, hrvar = "Organization") # Return summary table +\donttest{ collaboration_area(sq_data, return = "table") +} } \seealso{ diff --git a/man/external_network_plot.Rd b/man/external_network_plot.Rd index 1f06e5c1..077e49df 100644 --- a/man/external_network_plot.Rd +++ b/man/external_network_plot.Rd @@ -42,7 +42,7 @@ Uses the metrics \code{External_network_size} and \code{Networking_outside_compa } \examples{ # Return plot -sq_data \%>\% external_network_plot(return = "plot") +external_network_plot(sq_data, return = "plot") } \seealso{ diff --git a/man/flex_index.Rd b/man/flex_index.Rd index 21f63aef..593e5216 100644 --- a/man/flex_index.Rd +++ b/man/flex_index.Rd @@ -162,12 +162,16 @@ em_data \%>\% flex_index(return = "plot", plot_method = "common") # Plot Flexibility Index over time +\donttest{ em_data \%>\% flex_index(return = "plot", plot_method = "time") +} # Return a summary table with the computed Flexibility Index +\donttest{ em_data \%>\% flex_index(hrvar = "Organization", return = "table") +} } \seealso{ diff --git a/man/internal_network_plot.Rd b/man/internal_network_plot.Rd index c2ec6ef4..cc4708d4 100644 --- a/man/internal_network_plot.Rd +++ b/man/internal_network_plot.Rd @@ -43,10 +43,10 @@ Uses the metrics \code{Internal_network_size} and } \examples{ # Return plot -sq_data \%>\% internal_network_plot(return = "plot") +internal_network_plot(sq_data, return = "plot") # Return summary table -sq_data \%>\% internal_network_plot(return = "table") +internal_network_plot(sq_data, return = "table") } \seealso{ diff --git a/man/keymetrics_scan.Rd b/man/keymetrics_scan.Rd index 1893d1b1..bfc9cb06 100644 --- a/man/keymetrics_scan.Rd +++ b/man/keymetrics_scan.Rd @@ -64,7 +64,9 @@ keymetrics_scan(sq_data) keymetrics_scan(sq_data, low = "purple", high = "yellow") # Return summary table +\donttest{ keymetrics_scan(sq_data, hrvar = "LevelDesignation", return = "table") +} } \seealso{ diff --git a/man/meeting_quality.Rd b/man/meeting_quality.Rd index f9e7cb8f..2d7b1b2b 100644 --- a/man/meeting_quality.Rd +++ b/man/meeting_quality.Rd @@ -54,12 +54,16 @@ a Standard Person Query as an input. meeting_quality(sq_data, return = "plot") # Return plot - showing multi-tasking \% +\donttest{ meeting_quality(sq_data, metric_x = "Multitasking_meeting_hours", return = "plot") +} # Return summary table +\donttest{ meeting_quality(sq_data, return = "table") +} } \seealso{ diff --git a/man/personas_hclust.Rd b/man/personas_hclust.Rd index 29722b17..381985f3 100644 --- a/man/personas_hclust.Rd +++ b/man/personas_hclust.Rd @@ -51,10 +51,12 @@ personas_hclust(sq_data, k = 4) # Return summary table +\donttest{ personas_hclust(sq_data, metrics = c("Collaboration_hours", "Workweek_span"), k = 4, return = "table") +} \donttest{ # Return data with clusters appended diff --git a/man/workpatterns_area.Rd b/man/workpatterns_area.Rd index 34896805..e90978d8 100644 --- a/man/workpatterns_area.Rd +++ b/man/workpatterns_area.Rd @@ -79,10 +79,14 @@ em_data <- em_data[em_data$Organization \%in\% orgs, ] workpatterns_area(em_data, return = "plot", values = "percent") # Return visualization of absolute values +\dontest{ workpatterns_area(em_data, return = "plot", values = "abs") +} # Return summary table +\donttest{ workpatterns_area(em_data, return = "table") +} } \seealso{