From a98584dabf7349b11e03c795cec833cc726174b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Yves=20de=20M=C3=BCllenheim?= Date: Wed, 1 May 2024 19:08:52 +0200 Subject: [PATCH 01/22] updated comments --- R/compute_accumulation_metrics.R | 45 ++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/R/compute_accumulation_metrics.R b/R/compute_accumulation_metrics.R index 3ce733c7..fbbafe43 100644 --- a/R/compute_accumulation_metrics.R +++ b/R/compute_accumulation_metrics.R @@ -98,18 +98,20 @@ compute_accumulation_metrics <- function( zoom_to = "23:59:59" ){ -# Filtering data based on selected dates and time periods, and adding a -# column containing "SED", NON-SED", or "Nonwear" labels +# Getting selected dates if (is.null(dates)) { selected_dates <- attributes(as.factor(data$date))$levels } else { selected_dates <- attributes(as.factor(dates))$levels } - # Fix bug: Convert Nas to "Nonwear" - data[[col_cat_int]] <- dplyr::if_else(is.na(data[[col_cat_int]]), "Nonwear", data[[col_cat_int]]) - - data <- +# Converting potential NAs created when collapsing data to longer epochs (from +# previous steps) to "Nonwear" +data[[col_cat_int]] <- dplyr::if_else(is.na(data[[col_cat_int]]), "Nonwear", data[[col_cat_int]]) + +# Filtering data based on selected dates and time periods, and adding a +# column 'new_intensity_category' containing "SED", PA, or "Nonwear" values +data <- data %>% dplyr::filter( date %in% as.Date(selected_dates) & @@ -127,28 +129,28 @@ if (is.null(dates)) { "SED", dplyr::if_else( .data[[col_cat_int]] == "Nonwear", - "Nonwear", - dplyr::if_else(is.na(.data[[col_cat_int]]), "Nonwear", "Nonwear") + "Nonwear", NA ) ) ) ) -# Updating bouts IDs +# Setting IDs for the new PA/SED/Nonwear bouts data$new_intensity_category <- as.factor(data$new_intensity_category) data$new_intensity_category_num <- as.numeric(as.character(forcats::fct_recode(data$new_intensity_category , "0" = "Nonwear", "1" = "SED", "2" = "PA"))) data$new_bout <- cumsum(c(1, as.numeric(diff(data$new_intensity_category_num))!= 0)) -# Getting arguments +# Getting the type of activity bout to be analyzed behaviour <- match.arg(behaviour) if(behaviour == "sed") {BEHAV <- "SED"; color_fill = c("#D9DBE5", "#A6ADD5", "#6A78C3", "#3F51B5"); auto_text = "sedentary"} if(behaviour == "pa") {BEHAV <- "PA"; color_fill = c("#EDD3DD", "#F38DB6", "#FA3B87", "#FF0066"); auto_text = "physical activity"} -# Getting correction factor related to the epoch length (reference epoch = 60 s); +# Getting the correction factor related to the epoch length (reference epoch = 60 s); # bout durations are computed in minutes cor_factor = 60 / (as.numeric(data[[col_time]][2] - data[[col_time]][1])) -# Summarising bout durations (in minutes) of interest by day +# Getting all the identified bouts of the kind of interest and their respective +# durations (in minutes) recap_bouts_by_day <- data %>% dplyr::group_by(date, new_bout, new_intensity_category) %>% @@ -166,7 +168,7 @@ recap_bouts_by_day <- ) -# Computing mean daily number of breaks +# Computing the mean of the daily number of breaks mean_breaks <- recap_bouts_by_day %>% dplyr::ungroup(new_bout, new_intensity_category) %>% @@ -206,19 +208,21 @@ mean_breaks <- fill = dur_cat ) ) + - geom_rect(aes( + annotate( + geom = "rect", xmin = hms::as_hms(0), xmax = hms::as_hms(valid_wear_time_start), ymin = -Inf, - ymax = Inf), + ymax = Inf, color = "grey", fill = "grey" ) + - geom_rect(aes( + annotate( + geom = "rect", xmin = hms::as_hms(valid_wear_time_end), xmax = hms::as_hms("23:59:59"), ymin = -Inf, - ymax = Inf), + ymax = Inf, color = "grey", fill = "grey" ) + @@ -266,7 +270,8 @@ mean_breaks <- geom_vline(aes(xintercept = 3600*22), linetype = "dotted", color = "grey50") + geom_vline(aes(xintercept = 3600*23), linetype = "dotted", color = "grey50") -# Summarising bout durations (in minutes) of interest without grouping by day +# Getting all the identified bouts of the kind of interest and their respective +# durations (in minutes) without grouping by day recap_bouts <- data %>% dplyr::group_by(new_bout, new_intensity_category) %>% @@ -308,7 +313,7 @@ summarised_bouts <- ) -# Fitting cumulated fraction of time vs bout duration +# Fitting cumulated fraction of time vs bout duration relationship model <- nls( cum_frac_time ~ duration^x / (duration^x + UBD^x), data = summarised_bouts, @@ -352,7 +357,7 @@ max_bout_duration <- max(summarised_bouts$duration) p_MBD <- ggplot(data = recap_bouts) + geom_histogram(aes(x = duration, fill = dur_cat), binwidth = xmin) + - geom_segment(aes(x = MBD, xend = MBD, y = 0, yend = max(summarised_bouts$n, na.rm = TRUE)), linetype = "dashed") + + annotate(geom = "segment", x = MBD, xend = MBD, y = 0, yend = max(summarised_bouts$n, na.rm = TRUE), linetype = "dashed") + scale_fill_manual(values = color_fill) + labs(x = "Bout duration (min)", y = "n", fill = "Duration (min)") + geom_segment( From 3970f9c16209e15c32f382433a909f8cb47cd395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Yves=20de=20M=C3=BCllenheim?= Date: Wed, 1 May 2024 19:15:56 +0200 Subject: [PATCH 02/22] solved the problem of NAs generated in the 'wearing' column when data were collapsed from shorter epoch to longer epochs. --- R/compute_accumulation_metrics.R | 4 ---- R/mark_wear_time.R | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/R/compute_accumulation_metrics.R b/R/compute_accumulation_metrics.R index fbbafe43..b0093ced 100644 --- a/R/compute_accumulation_metrics.R +++ b/R/compute_accumulation_metrics.R @@ -105,10 +105,6 @@ if (is.null(dates)) { selected_dates <- attributes(as.factor(dates))$levels } -# Converting potential NAs created when collapsing data to longer epochs (from -# previous steps) to "Nonwear" -data[[col_cat_int]] <- dplyr::if_else(is.na(data[[col_cat_int]]), "Nonwear", data[[col_cat_int]]) - # Filtering data based on selected dates and time periods, and adding a # column 'new_intensity_category' containing "SED", PA, or "Nonwear" values data <- diff --git a/R/mark_wear_time.R b/R/mark_wear_time.R index c67e260b..a106e5ee 100644 --- a/R/mark_wear_time.R +++ b/R/mark_wear_time.R @@ -108,10 +108,12 @@ mark_wear_time <- function( streamFrame = streamFrame ) %>% dplyr::mutate( + wearing = dplyr::if_else(is.na(wearing), "nw", wearing), non_wearing_count = dplyr::if_else(wearing == "nw", 1, 0), wearing_count = dplyr::if_else(wearing == "w", 1, 0) ) + return(df2) } From 23238486c7e98ba5e93cf8c14268a3159a1389be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Yves=20de=20M=C3=BCllenheim?= Date: Wed, 1 May 2024 21:20:39 +0200 Subject: [PATCH 03/22] adjusted code so that all graphics related to activity accumulation metrics are correct when using epochs different from 1 min. --- R/compute_accumulation_metrics.R | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/R/compute_accumulation_metrics.R b/R/compute_accumulation_metrics.R index b0093ced..b9a5081c 100644 --- a/R/compute_accumulation_metrics.R +++ b/R/compute_accumulation_metrics.R @@ -334,24 +334,24 @@ max_bout_duration <- max(summarised_bouts$duration) duration = seq(xmin, max_bout_duration, 0.1) ) %>% dplyr::mutate( - pred = duration ^ (-alpha) , + pred = duration ^ (-alpha), pred = duration ^ (-alpha) / max(pred) * max(summarised_bouts$n, na.rm = TRUE) ) # Building the graphic p_alpha <- - ggplot(data = recap_bouts) + + ggplot(data = recap_bouts |> dplyr::ungroup(new_bout)) + geom_histogram(aes(x = duration, fill = dur_cat), binwidth = xmin) + scale_fill_manual(values = color_fill) + labs(x = "Bout duration (min)", y = "n", fill = "Duration (min)") + - geom_line(data = df_pred_alpha, aes(x = duration, y = pred), linewidth = 0.8, color = "grey10") + + geom_line(data = df_pred_alpha, aes(x = duration, y = pred), linewidth = 0.5, color = "grey10") + annotate("text", x = max_bout_duration/2, y = max(summarised_bouts$n, na.rm = TRUE)/2, label = paste("alpha =", round(alpha, 2)), hjust = 0.5, size = 6, vjust = 0.5) + theme_bw() + theme(legend.position = "bottom") # Building a graphic for MBD p_MBD <- - ggplot(data = recap_bouts) + + ggplot(data = recap_bouts |> dplyr::ungroup(new_bout)) + geom_histogram(aes(x = duration, fill = dur_cat), binwidth = xmin) + annotate(geom = "segment", x = MBD, xend = MBD, y = 0, yend = max(summarised_bouts$n, na.rm = TRUE), linetype = "dashed") + scale_fill_manual(values = color_fill) + @@ -378,10 +378,10 @@ p_MBD <- p_UBD <- ggplot(data = summarised_bouts, aes(x = duration, y = cum_frac_time)) + geom_point(aes(color = dur_cat), size = 6) + - geom_segment(aes(x = 0, y = 0.5, xend = UBD, yend = 0.5), linetype = "dashed", linewidth = 0.5) + - geom_segment(aes(x = UBD, y = 0.5, xend = UBD, yend = 0), linetype = "dashed", linewidth = 0.5) + - geom_line(data = df_pred_UBD, aes(x = duration, y = pred), linewidth = 0.8, color = "grey10") + - geom_segment(aes(x = max_bout_duration/2, y = 0.4, xend = UBD, yend = 0), arrow = arrow(length = unit(0.02, "npc"))) + + annotate(geom = "segment", x = 0, y = 0.5, xend = UBD, yend = 0.5, linetype = "dashed", linewidth = 0.5) + + annotate(geom = "segment", x = UBD, y = 0.5, xend = UBD, yend = 0, linetype = "dashed", linewidth = 0.5) + + geom_line(data = df_pred_UBD, aes(x = duration, y = pred), linewidth = 0.5, color = "grey10") + + annotate(geom = "segment", x = max_bout_duration/2, y = 0.4, xend = UBD, yend = 0, arrow = arrow(length = unit(0.02, "npc"))) + annotate("text", x = max_bout_duration/2, y = 0.4, label = paste(" UBD =", round(UBD, 1), "min"), hjust = 0, size = 6, vjust = 0) + labs(x = "Bout duration (min)", y = paste("Cumulated fraction of total", auto_text, "time"), color = "Duration (min)") + scale_color_manual(values = color_fill) + @@ -418,7 +418,7 @@ p_gini <- geom_ribbon(aes(x = cum_frac_bout, ymin = cum_frac_time, ymax = cum_frac_bout), fill = alpha(color_fill[[2]], 0.3)) + geom_point(data = summarised_bouts2, aes(color = dur_cat), size = 6) + geom_segment(x = 0, xend = 1, y = 0, yend = 1, linewidth = 0.3) + - geom_line(linewidth = 0.6) + + geom_line(linewidth = 0.5) + scale_color_manual(values = color_fill) + coord_cartesian(xlim = c(0, 1), ylim = c(0, 1)) + labs( From 5f734a691946db945bbf36a2bda8a3d948f45bd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Yves=20de=20M=C3=BCllenheim?= Date: Wed, 1 May 2024 21:40:05 +0200 Subject: [PATCH 04/22] corrected an error in the computation of MX5 --- R/compute_intensity_distri_metrics.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/compute_intensity_distri_metrics.R b/R/compute_intensity_distri_metrics.R index c6bf2e24..cafe4794 100644 --- a/R/compute_intensity_distri_metrics.R +++ b/R/compute_intensity_distri_metrics.R @@ -154,7 +154,7 @@ df_mx <- M60 = compute_mx(x = .data[[col_axis]], n = 60 * cor_factor), M30 = compute_mx(x = .data[[col_axis]], n = 30 * cor_factor), M15 = compute_mx(x = .data[[col_axis]], n = 15 * cor_factor), - M5 = compute_mx(x = .data[[col_axis]], n = 15 * cor_factor) + M5 = compute_mx(x = .data[[col_axis]], n = 5 * cor_factor) ) From 39d8104df00161001af8176b1a4cc323b0ddd153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Yves=20de=20M=C3=BCllenheim?= Date: Wed, 1 May 2024 21:41:16 +0200 Subject: [PATCH 05/22] modified settings to compute the intensity bands relating to the intensity gradient --- R/get_ig_results.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/get_ig_results.R b/R/get_ig_results.R index a308018f..1ff5be85 100644 --- a/R/get_ig_results.R +++ b/R/get_ig_results.R @@ -54,7 +54,7 @@ get_ig_results <- function( df_bins$bin_label <- paste0(round(df_bins$bin_start, 0),"-", round(df_bins$bin_end, 0)) # Correcting the value of the upper bound of the last bin (the value has been arbitrarily set so that it is very high) - df_bins[nrow(df_bins), "bin_end"] <- 50000 + df_bins[nrow(df_bins), "bin_end"] <- 1000000 # Correcting the label of the last bin df_bins[nrow(df_bins), "bin_label"] <- paste0(">", round(df_bins[nrow(df_bins), "bin_start"]-1, 0)) From e22ed99a3ed59903554c9bc2fa073ccf34845a70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Yves=20de=20M=C3=BCllenheim?= Date: Wed, 1 May 2024 21:41:45 +0200 Subject: [PATCH 06/22] updated documentation for MX metrics --- R/recap_by_day.R | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/R/recap_by_day.R b/R/recap_by_day.R index d4f45033..977baad1 100644 --- a/R/recap_by_day.R +++ b/R/recap_by_day.R @@ -35,12 +35,12 @@ #' \item \strong{peak_steps_5min:} step accumulation per minute averaged over the best 5 continuous or discontinuous minutes #' \item \strong{peak_steps_1min:} step accumulation per minute over the best minute (same result as for `max_steps_1min`) #' \item \strong{ig:} intensity gradient -#' \item \strong{M1/3:} the count value (in counts/epoch duration) above which the most active 8h were accumulated over the day -#' \item \strong{M120:} the count value (in counts/epoch duration) above which the most active 120 minutes were accumulated over the day -#' \item \strong{M60:} the count value (in counts/epoch duration) above which the most active 60 minutes were accumulated over the day -#' \item \strong{M30:} the count value (in counts/epoch duration) above which the most active 30 minutes were accumulated over the day -#' \item \strong{M15:} the count value (in counts/epoch duration) above which the most active 15 minutes were accumulated over the day -#' \item \strong{M5:} the count value (in counts/epoch duration) above which the most active 5 minutes were accumulated over the day +#' \item \strong{M1/3:} the count value (in counts/epoch duration) at and above which the most active 8h were accumulated over the day +#' \item \strong{M120:} the count value (in counts/epoch duration) at and above which the most active 120 minutes were accumulated over the day +#' \item \strong{M60:} the count value (in counts/epoch duration) at and above which the most active 60 minutes were accumulated over the day +#' \item \strong{M30:} the count value (in counts/epoch duration) at and above which the most active 30 minutes were accumulated over the day +#' \item \strong{M15:} the count value (in counts/epoch duration) at and above which the most active 15 minutes were accumulated over the day +#' \item \strong{M5:} the count value (in counts/epoch duration) at and above which the most active 5 minutes were accumulated over the day #'} #' #'PAL is computed by dividing total energy expenditure (TEE) by BMR. TEE is obtained by summing From 835c5174263f0f03ab7c428b5ee7bf9ae064178b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Yves=20de=20M=C3=BCllenheim?= Date: Wed, 1 May 2024 22:01:02 +0200 Subject: [PATCH 07/22] updated ga workflow for test coverage --- .github/workflows/test-coverage.yaml | 32 ++++++---------------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index dc6c1d4b..9881e5cc 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -1,45 +1,25 @@ -# Workflow derived from https://github.com/rstudio/shinytest2/tree/main/actions/test-app/example-test-app-description.yaml +# File from: https://github.com/r-lib/actions/blob/v2/examples/test-coverage.yaml +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: branches: [main, master] pull_request: branches: [main, master] - -name: Test app w/ {renv} - +name: test-coverage jobs: - test-app: - runs-on: ${{ matrix.config.os }} - - name: ${{ matrix.config.os }} (${{ matrix.config.r }}) - - strategy: - fail-fast: false - matrix: - config: - - {os: ubuntu-latest, r: release} - + test-coverage: + runs-on: ubuntu-latest env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - R_KEEP_PKG_SOURCE: yes - steps: - - uses: actions/checkout@v3 - - - uses: r-lib/actions/setup-pandoc@v2 - + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-r@v2 with: - r-version: ${{ matrix.config.r }} use-public-rspm: true - uses: r-lib/actions/setup-renv@v2 - - uses: rstudio/shinytest2/actions/test-app@actions/v1 - with: - app-dir: "." - - name: Test coverage run: covr::codecov(quiet = FALSE, clean = FALSE) shell: Rscript {0} From b307c2a179e3acbd088d386891cf91ef862aac3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Yves=20de=20M=C3=BCllenheim?= Date: Wed, 1 May 2024 22:02:07 +0200 Subject: [PATCH 08/22] replaced 'legend.position' argument by 'legend.position.inside' because it generated a warning in r devel --- R/create_fig_mx_summary.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/create_fig_mx_summary.R b/R/create_fig_mx_summary.R index e729c51e..e36aa295 100644 --- a/R/create_fig_mx_summary.R +++ b/R/create_fig_mx_summary.R @@ -126,7 +126,7 @@ p <- axis.text.x = element_text(size = 15), legend.text = element_text(size = 12), legend.key.width = unit(1.5,"cm"), - legend.position = c(0.13, 0.07) + legend.position.inside = c(0.13, 0.07) ) + guides(color = "none", fill = "none") From ef78e1e250a281003f4c4cc8faf159f025b2e4c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Yves=20de=20M=C3=BCllenheim?= Date: Wed, 1 May 2024 23:06:01 +0200 Subject: [PATCH 09/22] moved from the 'legend.position' to 'legend.position.inside' argument with ggplot2 --- R/create_fig_pal.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/create_fig_pal.R b/R/create_fig_pal.R index fe59b92c..4b40014a 100644 --- a/R/create_fig_pal.R +++ b/R/create_fig_pal.R @@ -151,7 +151,7 @@ if (language == "de") { theme(axis.ticks = element_blank(), axis.text.y = element_blank(), axis.text.x = element_text(size = 13), - legend.position = c(0.5, 1.4), + legend.position.inside = c(0.5, 1.4), legend.title = element_text(face = "bold" , size = 10), legend.text = element_text(face = "bold", size = 17), legend.background = element_rect(fill = "beige"), From 89393a64041c89057b8d011c03c1390bcd02b990 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Yves=20de=20M=C3=BCllenheim?= Date: Wed, 1 May 2024 23:18:14 +0200 Subject: [PATCH 10/22] updated doc --- man/do_all_analyses.Rd | 2 +- man/recap_by_day.Rd | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/man/do_all_analyses.Rd b/man/do_all_analyses.Rd index 0af15260..ed4e54f5 100644 --- a/man/do_all_analyses.Rd +++ b/man/do_all_analyses.Rd @@ -4,7 +4,7 @@ \alias{do_all_analyses} \title{Do all analyses at once} \usage{ -do_all_analyses() +do_all_analyses(to_epoch = 60) } \value{ A dataset (1 row) with all computed metrics. diff --git a/man/recap_by_day.Rd b/man/recap_by_day.Rd index d13ee2cb..1318a869 100644 --- a/man/recap_by_day.Rd +++ b/man/recap_by_day.Rd @@ -91,12 +91,12 @@ The following metrics are computed from epochs corresponding to valid wear time: \item \strong{peak_steps_5min:} step accumulation per minute averaged over the best 5 continuous or discontinuous minutes \item \strong{peak_steps_1min:} step accumulation per minute over the best minute (same result as for \code{max_steps_1min}) \item \strong{ig:} intensity gradient -\item \strong{M1/3:} the count value (in counts/epoch duration) above which the most active 8h were accumulated over the day -\item \strong{M120:} the count value (in counts/epoch duration) above which the most active 120 minutes were accumulated over the day -\item \strong{M60:} the count value (in counts/epoch duration) above which the most active 60 minutes were accumulated over the day -\item \strong{M30:} the count value (in counts/epoch duration) above which the most active 30 minutes were accumulated over the day -\item \strong{M15:} the count value (in counts/epoch duration) above which the most active 15 minutes were accumulated over the day -\item \strong{M5:} the count value (in counts/epoch duration) above which the most active 5 minutes were accumulated over the day +\item \strong{M1/3:} the count value (in counts/epoch duration) at and above which the most active 8h were accumulated over the day +\item \strong{M120:} the count value (in counts/epoch duration) at and above which the most active 120 minutes were accumulated over the day +\item \strong{M60:} the count value (in counts/epoch duration) at and above which the most active 60 minutes were accumulated over the day +\item \strong{M30:} the count value (in counts/epoch duration) at and above which the most active 30 minutes were accumulated over the day +\item \strong{M15:} the count value (in counts/epoch duration) at and above which the most active 15 minutes were accumulated over the day +\item \strong{M5:} the count value (in counts/epoch duration) at and above which the most active 5 minutes were accumulated over the day } PAL is computed by dividing total energy expenditure (TEE) by BMR. TEE is obtained by summing From eaf3dc401f623c5be314909a4e94be681ec6b54a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Yves=20de=20M=C3=BCllenheim?= Date: Wed, 1 May 2024 23:18:30 +0200 Subject: [PATCH 11/22] updated workflow --- .github/workflows/test-coverage.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 9881e5cc..2a9bd422 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -19,6 +19,12 @@ jobs: use-public-rspm: true - uses: r-lib/actions/setup-renv@v2 + + - name: Install covr + run: | + install.packages("covr", repos = "https://github.com/r-lib/covr/") + shell: Rscript {0} + - name: Test coverage run: covr::codecov(quiet = FALSE, clean = FALSE) From 7398516958059ecf2d6691cb13b76b41bf33735b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Yves=20de=20M=C3=BCllenheim?= Date: Wed, 1 May 2024 23:38:13 +0200 Subject: [PATCH 12/22] updated ci covr --- .github/workflows/test-coverage.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 2a9bd422..3d4a041b 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -22,10 +22,9 @@ jobs: - name: Install covr run: | - install.packages("covr", repos = "https://github.com/r-lib/covr/") + renv::install("covr") shell: Rscript {0} - - name: Test coverage run: covr::codecov(quiet = FALSE, clean = FALSE) shell: Rscript {0} From 45bf91a3d3c2cdfefe3d858df0d96d523d160e90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Yves=20de=20M=C3=BCllenheim?= Date: Thu, 2 May 2024 00:02:08 +0200 Subject: [PATCH 13/22] updated covr ci --- .github/workflows/test-coverage.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 3d4a041b..d01c2286 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -24,6 +24,11 @@ jobs: run: | renv::install("covr") shell: Rscript {0} + + - name: Install testthat + run: | + renv::install("testthat") + shell: Rscript {0} - name: Test coverage run: covr::codecov(quiet = FALSE, clean = FALSE) From 04b4d14d83e8f8a8540fd2e1616c2bf73156c05c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Yves=20de=20M=C3=BCllenheim?= Date: Thu, 2 May 2024 00:16:50 +0200 Subject: [PATCH 14/22] added shinytest2 to covr workflow --- .github/workflows/test-coverage.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index d01c2286..85f18531 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -29,6 +29,11 @@ jobs: run: | renv::install("testthat") shell: Rscript {0} + + - name: Install shinytest2 + run: | + renv::install("shinytest2") + shell: Rscript {0} - name: Test coverage run: covr::codecov(quiet = FALSE, clean = FALSE) From 0f7e21e6d1fd911cc3c6960a0d073c4fd7c6b8e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Yves=20de=20M=C3=BCllenheim?= Date: Thu, 2 May 2024 22:45:27 +0200 Subject: [PATCH 15/22] updated test coverage --- .github/workflows/test-coverage.yaml | 64 +++++++++++++++++++--------- 1 file changed, 45 insertions(+), 19 deletions(-) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 85f18531..e9bdf092 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -1,41 +1,67 @@ -# File from: https://github.com/r-lib/actions/blob/v2/examples/test-coverage.yaml -# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples -# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +# Workflow derived from https://github.com/alexquant1993/shareIBC/blob/master/.github/workflows/test-coverage.yaml on: push: branches: [main, master] pull_request: branches: [main, master] + name: test-coverage + jobs: test-coverage: runs-on: ubuntu-latest env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + RENV_PATHS_ROOT: ~/.local/share/renv steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v2 + - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - - uses: r-lib/actions/setup-renv@v2 - - - name: Install covr - run: | - renv::install("covr") - shell: Rscript {0} - - - name: Install testthat + - name: Cache packages + uses: actions/cache@v1 + with: + path: ${{ env.RENV_PATHS_ROOT }} + key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }} + restore-keys: ${{ runner.os }}-renv- + + - name: Install Linux system dependencies + if: runner.os == 'Linux' + shell: bash run: | - renv::install("testthat") + sudo apt-get install -y software-properties-common + sudo apt-get update + sudo apt-get install -y make + sudo apt-get install -y git + sudo apt-get install -y libcurl4-openssl-dev + sudo apt-get install -y libfribidi-dev + sudo apt-get install -y libgit2-dev + sudo apt-get install -y libharfbuzz-dev + sudo apt-get install -y libicu-dev + sudo apt-get install -y libssl-dev + sudo apt-get install -y libxml2-dev + sudo apt-get install -y libsodium-dev + sudo apt-get install -y python3 + sudo apt-get install -y python3-pip + sudo apt-get install -y python3-venv + + - name: Restore packages shell: Rscript {0} - - - name: Install shinytest2 run: | - renv::install("shinytest2") - shell: Rscript {0} + if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv") + renv::restore() + + - name: Install activAnalyzer + shell: bash + run: R CMD INSTALL --preclean . - name: Test coverage - run: covr::codecov(quiet = FALSE, clean = FALSE) + run: covr::codecov(quiet = FALSE) shell: Rscript {0} - \ No newline at end of file + + - name: Show testthat output + if: always() + run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true + shell: bash \ No newline at end of file From e5a41ecdc664847769a0d21676f5e677fcc165a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Yves=20de=20M=C3=BCllenheim?= Date: Thu, 2 May 2024 23:02:39 +0200 Subject: [PATCH 16/22] updated test-coverage --- .github/workflows/test-coverage.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index e9bdf092..682f4734 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -56,6 +56,10 @@ jobs: - name: Install activAnalyzer shell: bash run: R CMD INSTALL --preclean . + + - name: Install covr + run: renv::install("covr") + shell: Rscript {0} - name: Test coverage run: covr::codecov(quiet = FALSE) From 6cea72f5ed38a9829605b15f1c8e13a5034e0ef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Yves=20de=20M=C3=BCllenheim?= Date: Thu, 2 May 2024 23:19:25 +0200 Subject: [PATCH 17/22] update test coverage new attempt --- .github/workflows/test-coverage.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 682f4734..9418dd93 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -60,7 +60,15 @@ jobs: - name: Install covr run: renv::install("covr") shell: Rscript {0} + + - name: Install testthat + run: renv::install("testthat") + shell: Rscript {0} + - name: Install shinytest2 + run: renv::install("shinytest2") + shell: Rscript {0} + - name: Test coverage run: covr::codecov(quiet = FALSE) shell: Rscript {0} From c159760a45791f4aa3b19989ca6c8bbff127ec66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Yves=20de=20M=C3=BCllenheim?= Date: Fri, 3 May 2024 15:58:47 +0200 Subject: [PATCH 18/22] ga workflows update: new attempt --- .Rbuildignore | 1 + .github/workflows/R-CMD-check.yaml | 29 +++-------- .github/workflows/test-coverage.yaml | 77 +++++++++------------------- README.Rmd | 2 +- README.md | 2 +- 5 files changed, 35 insertions(+), 76 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index f58723f3..f02115e1 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -32,3 +32,4 @@ $run_dev.* ^Meta$ _\.new\.png$ ^temp$ +^\.github$ diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index c5d9dadd..7dd9b2e0 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -1,4 +1,4 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: @@ -19,16 +19,16 @@ jobs: matrix: config: - {os: windows-latest, r: 'release'} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - {os: ubuntu-latest, r: 'release'} - - {os: windows-latest, r: 'devel'} - - {os: ubuntu-latest, r: 'devel'} + - {os: ubuntu-latest, r: 'oldrel-1'} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 @@ -37,26 +37,13 @@ jobs: r-version: ${{ matrix.config.r }} http-user-agent: ${{ matrix.config.http-user-agent }} use-public-rspm: true - - - name: Install sessioninfo - run: | - install.packages("sessioninfo") - shell: Rscript {0} - uses: r-lib/actions/setup-r-dependencies@v2 with: extra-packages: any::rcmdcheck - - - uses: r-lib/actions/check-r-package@v2 - - - name: Show testthat output - if: always() - run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true - shell: bash + needs: check - - name: Upload check results - if: failure() - uses: actions/upload-artifact@main + - uses: r-lib/actions/check-r-package@v2 with: - name: ${{ runner.os }}-r${{ matrix.config.r }}-results - path: check + upload-snapshots: true + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 9418dd93..21b8a933 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -1,4 +1,5 @@ -# Workflow derived from https://github.com/alexquant1993/shareIBC/blob/master/.github/workflows/test-coverage.yaml +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: branches: [main, master] @@ -12,68 +13,38 @@ jobs: runs-on: ubuntu-latest env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - RENV_PATHS_ROOT: ~/.local/share/renv + steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - - name: Cache packages - uses: actions/cache@v1 + - uses: r-lib/actions/setup-r-dependencies@v2 with: - path: ${{ env.RENV_PATHS_ROOT }} - key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }} - restore-keys: ${{ runner.os }}-renv- - - - name: Install Linux system dependencies - if: runner.os == 'Linux' - shell: bash - run: | - sudo apt-get install -y software-properties-common - sudo apt-get update - sudo apt-get install -y make - sudo apt-get install -y git - sudo apt-get install -y libcurl4-openssl-dev - sudo apt-get install -y libfribidi-dev - sudo apt-get install -y libgit2-dev - sudo apt-get install -y libharfbuzz-dev - sudo apt-get install -y libicu-dev - sudo apt-get install -y libssl-dev - sudo apt-get install -y libxml2-dev - sudo apt-get install -y libsodium-dev - sudo apt-get install -y python3 - sudo apt-get install -y python3-pip - sudo apt-get install -y python3-venv - - - name: Restore packages - shell: Rscript {0} - run: | - if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv") - renv::restore() - - - name: Install activAnalyzer - shell: bash - run: R CMD INSTALL --preclean . - - - name: Install covr - run: renv::install("covr") - shell: Rscript {0} - - - name: Install testthat - run: renv::install("testthat") - shell: Rscript {0} + extra-packages: any::covr + needs: coverage - - name: Install shinytest2 - run: renv::install("shinytest2") - shell: Rscript {0} - - name: Test coverage - run: covr::codecov(quiet = FALSE) + run: | + covr::codecov( + quiet = FALSE, + clean = FALSE, + install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") + ) shell: Rscript {0} - name: Show testthat output if: always() - run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true - shell: bash \ No newline at end of file + run: | + ## -------------------------------------------------------------------- + find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true + shell: bash + + - name: Upload test results + if: failure() + uses: actions/upload-artifact@v4 + with: + name: coverage-test-failures + path: ${{ runner.temp }}/package diff --git a/README.Rmd b/README.Rmd index 971ad0ba..178c40fc 100644 --- a/README.Rmd +++ b/README.Rmd @@ -17,7 +17,7 @@ knitr::opts_chunk$set( [![CRAN status](https://www.r-pkg.org/badges/version/activAnalyzer)](https://CRAN.R-project.org/package=activAnalyzer) [![Codecov test coverage](https://codecov.io/gh/pydemull/activAnalyzer/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pydemull/activAnalyzer?branch=master) [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) -[![R-CMD-check](https://github.com/pydemull/activAnalyzer/workflows/R-CMD-check/badge.svg)](https://github.com/pydemull/activAnalyzer/actions) +[![R-CMD-check](https://github.com/pydemull/activAnalyzer/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/pydemull/activAnalyzer/actions/workflows/R-CMD-check.yaml) [![](http://cranlogs.r-pkg.org/badges/grand-total/activAnalyzer?color=blue)](https://cran.r-project.org/package=activAnalyzer) [![status](https://joss.theoj.org/papers/5d6659af1bf8ca2fb977c189039b8315/status.svg)](https://joss.theoj.org/papers/10.21105/joss.04741) diff --git a/README.md b/README.md index 3833c197..e6be1c17 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ status](https://www.r-pkg.org/badges/version/activAnalyzer)](https://CRAN.R-proj coverage](https://codecov.io/gh/pydemull/activAnalyzer/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pydemull/activAnalyzer?branch=master) [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) -[![R-CMD-check](https://github.com/pydemull/activAnalyzer/workflows/R-CMD-check/badge.svg)](https://github.com/pydemull/activAnalyzer/actions) +[![R-CMD-check](https://github.com/pydemull/activAnalyzer/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/pydemull/activAnalyzer/actions/workflows/R-CMD-check.yaml) [![](http://cranlogs.r-pkg.org/badges/grand-total/activAnalyzer?color=blue)](https://cran.r-project.org/package=activAnalyzer) [![status](https://joss.theoj.org/papers/5d6659af1bf8ca2fb977c189039b8315/status.svg)](https://joss.theoj.org/papers/10.21105/joss.04741) From 51cf908f43031e129d7a07e4501d1889140aaedf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Yves=20de=20M=C3=BCllenheim?= Date: Fri, 3 May 2024 15:58:47 +0200 Subject: [PATCH 19/22] ga workflows update: new attempt --- .Rbuildignore | 1 + .github/workflows/R-CMD-check.yaml | 30 +++-------- .github/workflows/test-coverage.yaml | 79 +++++++++------------------- README.Rmd | 2 +- README.md | 2 +- 5 files changed, 36 insertions(+), 78 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index f58723f3..f02115e1 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -32,3 +32,4 @@ $run_dev.* ^Meta$ _\.new\.png$ ^temp$ +^\.github$ diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index c5d9dadd..c81d6459 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -1,4 +1,4 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: @@ -19,16 +19,15 @@ jobs: matrix: config: - {os: windows-latest, r: 'release'} - - {os: ubuntu-latest, r: 'release'} - - {os: windows-latest, r: 'devel'} - - {os: ubuntu-latest, r: 'devel'} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 @@ -37,26 +36,13 @@ jobs: r-version: ${{ matrix.config.r }} http-user-agent: ${{ matrix.config.http-user-agent }} use-public-rspm: true - - - name: Install sessioninfo - run: | - install.packages("sessioninfo") - shell: Rscript {0} - uses: r-lib/actions/setup-r-dependencies@v2 with: extra-packages: any::rcmdcheck - - - uses: r-lib/actions/check-r-package@v2 - - - name: Show testthat output - if: always() - run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true - shell: bash + needs: check - - name: Upload check results - if: failure() - uses: actions/upload-artifact@main + - uses: r-lib/actions/check-r-package@v2 with: - name: ${{ runner.os }}-r${{ matrix.config.r }}-results - path: check + upload-snapshots: true + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 9418dd93..bf6c7519 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -1,4 +1,5 @@ -# Workflow derived from https://github.com/alexquant1993/shareIBC/blob/master/.github/workflows/test-coverage.yaml +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: branches: [main, master] @@ -9,71 +10,41 @@ name: test-coverage jobs: test-coverage: - runs-on: ubuntu-latest + runs-on: windows-latest env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - RENV_PATHS_ROOT: ~/.local/share/renv + steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - - name: Cache packages - uses: actions/cache@v1 + - uses: r-lib/actions/setup-r-dependencies@v2 with: - path: ${{ env.RENV_PATHS_ROOT }} - key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }} - restore-keys: ${{ runner.os }}-renv- - - - name: Install Linux system dependencies - if: runner.os == 'Linux' - shell: bash - run: | - sudo apt-get install -y software-properties-common - sudo apt-get update - sudo apt-get install -y make - sudo apt-get install -y git - sudo apt-get install -y libcurl4-openssl-dev - sudo apt-get install -y libfribidi-dev - sudo apt-get install -y libgit2-dev - sudo apt-get install -y libharfbuzz-dev - sudo apt-get install -y libicu-dev - sudo apt-get install -y libssl-dev - sudo apt-get install -y libxml2-dev - sudo apt-get install -y libsodium-dev - sudo apt-get install -y python3 - sudo apt-get install -y python3-pip - sudo apt-get install -y python3-venv - - - name: Restore packages - shell: Rscript {0} - run: | - if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv") - renv::restore() - - - name: Install activAnalyzer - shell: bash - run: R CMD INSTALL --preclean . - - - name: Install covr - run: renv::install("covr") - shell: Rscript {0} - - - name: Install testthat - run: renv::install("testthat") - shell: Rscript {0} + extra-packages: any::covr + needs: coverage - - name: Install shinytest2 - run: renv::install("shinytest2") - shell: Rscript {0} - - name: Test coverage - run: covr::codecov(quiet = FALSE) + run: | + covr::codecov( + quiet = FALSE, + clean = FALSE, + install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") + ) shell: Rscript {0} - name: Show testthat output if: always() - run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true - shell: bash \ No newline at end of file + run: | + ## -------------------------------------------------------------------- + find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true + shell: bash + + - name: Upload test results + if: failure() + uses: actions/upload-artifact@v4 + with: + name: coverage-test-failures + path: ${{ runner.temp }}/package diff --git a/README.Rmd b/README.Rmd index 971ad0ba..178c40fc 100644 --- a/README.Rmd +++ b/README.Rmd @@ -17,7 +17,7 @@ knitr::opts_chunk$set( [![CRAN status](https://www.r-pkg.org/badges/version/activAnalyzer)](https://CRAN.R-project.org/package=activAnalyzer) [![Codecov test coverage](https://codecov.io/gh/pydemull/activAnalyzer/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pydemull/activAnalyzer?branch=master) [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) -[![R-CMD-check](https://github.com/pydemull/activAnalyzer/workflows/R-CMD-check/badge.svg)](https://github.com/pydemull/activAnalyzer/actions) +[![R-CMD-check](https://github.com/pydemull/activAnalyzer/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/pydemull/activAnalyzer/actions/workflows/R-CMD-check.yaml) [![](http://cranlogs.r-pkg.org/badges/grand-total/activAnalyzer?color=blue)](https://cran.r-project.org/package=activAnalyzer) [![status](https://joss.theoj.org/papers/5d6659af1bf8ca2fb977c189039b8315/status.svg)](https://joss.theoj.org/papers/10.21105/joss.04741) diff --git a/README.md b/README.md index 3833c197..e6be1c17 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ status](https://www.r-pkg.org/badges/version/activAnalyzer)](https://CRAN.R-proj coverage](https://codecov.io/gh/pydemull/activAnalyzer/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pydemull/activAnalyzer?branch=master) [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) -[![R-CMD-check](https://github.com/pydemull/activAnalyzer/workflows/R-CMD-check/badge.svg)](https://github.com/pydemull/activAnalyzer/actions) +[![R-CMD-check](https://github.com/pydemull/activAnalyzer/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/pydemull/activAnalyzer/actions/workflows/R-CMD-check.yaml) [![](http://cranlogs.r-pkg.org/badges/grand-total/activAnalyzer?color=blue)](https://cran.r-project.org/package=activAnalyzer) [![status](https://joss.theoj.org/papers/5d6659af1bf8ca2fb977c189039b8315/status.svg)](https://joss.theoj.org/papers/10.21105/joss.04741) From 1960cf709f07bd379e9fcd5c0047d7baeb7ec348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Yves=20de=20M=C3=BCllenheim?= Date: Fri, 3 May 2024 16:26:39 +0200 Subject: [PATCH 20/22] updated workflows --- .github/workflows/R-CMD-check.yaml | 1 - tests/testthat.R | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 7dd9b2e0..c81d6459 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -20,7 +20,6 @@ jobs: config: - {os: windows-latest, r: 'release'} - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - - {os: ubuntu-latest, r: 'release'} - {os: ubuntu-latest, r: 'oldrel-1'} env: diff --git a/tests/testthat.R b/tests/testthat.R index 57ce894a..e5f7d027 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -1,4 +1,5 @@ library(testthat) +library(shiny) library(shinytest2) library(activAnalyzer) From 4d7dabbede5353351433b60b3c36662a3250c3c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Yves=20de=20M=C3=BCllenheim?= Date: Fri, 3 May 2024 16:57:37 +0200 Subject: [PATCH 21/22] updated the remaining 'legend.position' arguments to 'legend.position.inside' --- R/create_fig_pal.R | 4 ++-- tests/testthat.R | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/R/create_fig_pal.R b/R/create_fig_pal.R index 4b40014a..da85975d 100644 --- a/R/create_fig_pal.R +++ b/R/create_fig_pal.R @@ -60,7 +60,7 @@ if (language == "en") { theme(axis.ticks = element_blank(), axis.text.y = element_blank(), axis.text.x = element_text(size = 13), - legend.position = c(0.5, 1.4), + legend.position.inside = c(0.5, 1.4), legend.title = element_text(face = "bold" , size = 10), legend.text = element_text(face = "bold", size = 17), legend.background = element_rect(fill = "beige"), @@ -105,7 +105,7 @@ if (language == "fr") { theme(axis.ticks = element_blank(), axis.text.y = element_blank(), axis.text.x = element_text(size = 13), - legend.position = c(0.5, 1.4), + legend.position.inside = c(0.5, 1.4), legend.title = element_text(face = "bold" , size = 10), legend.text = element_text(face = "bold", size = 17), legend.background = element_rect(fill = "beige"), diff --git a/tests/testthat.R b/tests/testthat.R index e5f7d027..57ce894a 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -1,5 +1,4 @@ library(testthat) -library(shiny) library(shinytest2) library(activAnalyzer) From 375306d7e7416be862b3a231d0f2feb49fe749db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Yves=20de=20M=C3=BCllenheim?= Date: Fri, 3 May 2024 22:45:56 +0200 Subject: [PATCH 22/22] updated doc of the 'do_all_analyses' internal function --- R/do_all_analyses.R | 3 +++ man/do_all_analyses.Rd | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/R/do_all_analyses.R b/R/do_all_analyses.R index bf5c0979..fb54dc98 100644 --- a/R/do_all_analyses.R +++ b/R/do_all_analyses.R @@ -5,6 +5,9 @@ #' the package. It is an internal function allowing the computation of the speed of the whole #' analysis process, from the data importation to the final line of the results. #' +#' @param to_epoch A numeric value to set the epoch required to collapse counts +#' in seconds. +#' #' @return #' A dataset (1 row) with all computed metrics. diff --git a/man/do_all_analyses.Rd b/man/do_all_analyses.Rd index ed4e54f5..11678a68 100644 --- a/man/do_all_analyses.Rd +++ b/man/do_all_analyses.Rd @@ -6,6 +6,10 @@ \usage{ do_all_analyses(to_epoch = 60) } +\arguments{ +\item{to_epoch}{A numeric value to set the epoch required to collapse counts +in seconds.} +} \value{ A dataset (1 row) with all computed metrics. }