From c960d2f3bfa57c5e27d34c82c585cd8774550e03 Mon Sep 17 00:00:00 2001 From: SpatLyu Date: Mon, 26 Oct 2026 00:00:01 +0800 Subject: [PATCH 1/9] avoid using global variables --- R/formatoutput.R | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/R/formatoutput.R b/R/formatoutput.R index a6dc2dc..7f9e362 100644 --- a/R/formatoutput.R +++ b/R/formatoutput.R @@ -22,9 +22,12 @@ print.pc_ops = \(x,...) { plot.pc_single = \(x, family = "serif", ...){ causdf = x$summary - ggplot2::ggplot(causdf, ggplot2::aes(x = type, y = strength, fill = type)) + + ggplot2::ggplot(causdf, + ggplot2::aes(x = .data[["type"]], + y = .data[["strength"]], + fill = .data[["type"]])) + ggplot2::geom_col() + - ggplot2::geom_text(ggplot2::aes(label = round(strength, 3)), vjust = -0.5) + + ggplot2::geom_text(ggplot2::aes(label = round(.data[["strength"]], 3)), vjust = -0.5) + ggplot2::scale_y_continuous( limits = c(0, max(causdf$strength) * 1.1), expand = ggplot2::expansion(mult = c(0, 0.1)), @@ -52,7 +55,10 @@ plot.pc_boot = \(x, family = "serif", if(is.null(xlimits)) xlimits = c(min(xbreaks) - 1,max(xbreaks) + 1) if(is.null(ylimits)) ylimits = c(-0.01, max(causdf$q50) + 0.1) - ggplot2::ggplot(causdf, ggplot2::aes(x = libsizes, y = q50, color = type)) + + ggplot2::ggplot(causdf, + ggplot2::aes(x = .data[["libsizes"]], + y = .data[["q50"]], + color = .data[["type"]])) + ggplot2::geom_line(linewidth = 1.25) + ggplot2::scale_color_manual(name = NULL, values = c("dark" = "#6A0DAD", From e1c958995591f4c40a0e95fb99c65a4a62d70726 Mon Sep 17 00:00:00 2001 From: SpatLyu Date: Mon, 26 Oct 2026 00:00:01 +0800 Subject: [PATCH 2/9] avoid using global variables --- R/globals.R | 1 - 1 file changed, 1 deletion(-) delete mode 100644 R/globals.R diff --git a/R/globals.R b/R/globals.R deleted file mode 100644 index e04a6f9..0000000 --- a/R/globals.R +++ /dev/null @@ -1 +0,0 @@ -utils::globalVariables(c("libsizes", "strength", "type", "q50")) \ No newline at end of file From e582a66cdb6fc32ff0b38aa7239b75bd8b113814 Mon Sep 17 00:00:00 2001 From: SpatLyu Date: Mon, 26 Oct 2026 00:00:01 +0800 Subject: [PATCH 3/9] avoid using global variables --- R/formatoutput.R | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/R/formatoutput.R b/R/formatoutput.R index 7f9e362..cd7bd3c 100644 --- a/R/formatoutput.R +++ b/R/formatoutput.R @@ -23,11 +23,12 @@ plot.pc_single = \(x, family = "serif", ...){ causdf = x$summary ggplot2::ggplot(causdf, - ggplot2::aes(x = .data[["type"]], - y = .data[["strength"]], - fill = .data[["type"]])) + + ggplot2::aes(x = ggplot2::.data[["type"]], + y = ggplot2::.data[["strength"]], + fill = ggplot2::.data[["type"]])) + ggplot2::geom_col() + - ggplot2::geom_text(ggplot2::aes(label = round(.data[["strength"]], 3)), vjust = -0.5) + + ggplot2::geom_text(ggplot2::aes(label = round(ggplot2::.data[["strength"]], 3)), + vjust = -0.5) + ggplot2::scale_y_continuous( limits = c(0, max(causdf$strength) * 1.1), expand = ggplot2::expansion(mult = c(0, 0.1)), @@ -56,9 +57,9 @@ plot.pc_boot = \(x, family = "serif", if(is.null(ylimits)) ylimits = c(-0.01, max(causdf$q50) + 0.1) ggplot2::ggplot(causdf, - ggplot2::aes(x = .data[["libsizes"]], - y = .data[["q50"]], - color = .data[["type"]])) + + ggplot2::aes(x = ggplot2::.data[["libsizes"]], + y = ggplot2::.data[["q50"]], + color = ggplot2::.data[["type"]])) + ggplot2::geom_line(linewidth = 1.25) + ggplot2::scale_color_manual(name = NULL, values = c("dark" = "#6A0DAD", From 95e6445ce633fdd2fde98116440b00a09fa6a32c Mon Sep 17 00:00:00 2001 From: SpatLyu Date: Mon, 26 Oct 2026 00:00:01 +0800 Subject: [PATCH 4/9] avoid using global variables --- R/formatoutput.R | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/R/formatoutput.R b/R/formatoutput.R index cd7bd3c..63486cf 100644 --- a/R/formatoutput.R +++ b/R/formatoutput.R @@ -23,11 +23,11 @@ plot.pc_single = \(x, family = "serif", ...){ causdf = x$summary ggplot2::ggplot(causdf, - ggplot2::aes(x = ggplot2::.data[["type"]], - y = ggplot2::.data[["strength"]], - fill = ggplot2::.data[["type"]])) + + ggplot2::aes(x = .data[["type"]], + y = .data[["strength"]], + fill = .data[["type"]])) + ggplot2::geom_col() + - ggplot2::geom_text(ggplot2::aes(label = round(ggplot2::.data[["strength"]], 3)), + ggplot2::geom_text(ggplot2::aes(label = round(.data[["strength"]], 3)), vjust = -0.5) + ggplot2::scale_y_continuous( limits = c(0, max(causdf$strength) * 1.1), @@ -57,9 +57,9 @@ plot.pc_boot = \(x, family = "serif", if(is.null(ylimits)) ylimits = c(-0.01, max(causdf$q50) + 0.1) ggplot2::ggplot(causdf, - ggplot2::aes(x = ggplot2::.data[["libsizes"]], - y = ggplot2::.data[["q50"]], - color = ggplot2::.data[["type"]])) + + ggplot2::aes(x = .data[["libsizes"]], + y = .data[["q50"]], + color = .data[["type"]])) + ggplot2::geom_line(linewidth = 1.25) + ggplot2::scale_color_manual(name = NULL, values = c("dark" = "#6A0DAD", From 0785674725d0dfb3b4e8edff86dc4274511113f3 Mon Sep 17 00:00:00 2001 From: SpatLyu Date: Mon, 26 Oct 2026 00:00:01 +0800 Subject: [PATCH 5/9] avoid using global variables --- R/zzz.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/zzz.R b/R/zzz.R index f45e1d2..899fa66 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -1,3 +1,5 @@ .onLoad = \(...) { requireNamespace("Rcpp", quietly = TRUE) } + +utils::globalVariables(".data") From 30a791d4580f838381d594e93fc8c6d5d0ce0ed9 Mon Sep 17 00:00:00 2001 From: SpatLyu Date: Mon, 26 Oct 2026 00:00:01 +0800 Subject: [PATCH 6/9] avoid using global variables --- R/pc-package.R | 2 ++ R/zzz.R | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/pc-package.R b/R/pc-package.R index 0e5c32b..77cf582 100644 --- a/R/pc-package.R +++ b/R/pc-package.R @@ -2,3 +2,5 @@ #' @useDynLib pc, .registration = TRUE ## usethis namespace: end NULL + +utils::globalVariables(".data") diff --git a/R/zzz.R b/R/zzz.R index 899fa66..f45e1d2 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -1,5 +1,3 @@ .onLoad = \(...) { requireNamespace("Rcpp", quietly = TRUE) } - -utils::globalVariables(".data") From d9d821308877216dcbb131aba6cc473bab80cf51 Mon Sep 17 00:00:00 2001 From: SpatLyu Date: Mon, 26 Oct 2026 00:00:01 +0800 Subject: [PATCH 7/9] avoid using global variables --- R/pc-package.R | 8 ++++++-- R/zzz.R | 3 --- 2 files changed, 6 insertions(+), 5 deletions(-) delete mode 100644 R/zzz.R diff --git a/R/pc-package.R b/R/pc-package.R index 77cf582..6bfd8d3 100644 --- a/R/pc-package.R +++ b/R/pc-package.R @@ -1,6 +1,10 @@ +.onLoad = \(...) { + requireNamespace("Rcpp", quietly = TRUE) +} + +utils::globalVariables(".data") + ## usethis namespace: start #' @useDynLib pc, .registration = TRUE ## usethis namespace: end NULL - -utils::globalVariables(".data") diff --git a/R/zzz.R b/R/zzz.R deleted file mode 100644 index f45e1d2..0000000 --- a/R/zzz.R +++ /dev/null @@ -1,3 +0,0 @@ -.onLoad = \(...) { - requireNamespace("Rcpp", quietly = TRUE) -} From e5e944ef9c14cd2dfe2a1d963de6f690351ac81a Mon Sep 17 00:00:00 2001 From: SpatLyu Date: Mon, 26 Oct 2026 00:00:01 +0800 Subject: [PATCH 8/9] upgrade roxygen2 version to `8.1.1` --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index ea463e4..52032f3 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -34,4 +34,4 @@ Suggests: rmarkdown VignetteBuilder: knitr Config/roxygen2/markdown: TRUE -Config/roxygen2/version: 8.1.0 +Config/roxygen2/version: 8.1.1 From 94270eddb18f40354a6d871bb617ac73d25caee6 Mon Sep 17 00:00:00 2001 From: SpatLyu Date: Mon, 26 Oct 2026 00:00:01 +0800 Subject: [PATCH 9/9] using fewer global variables --- R/pc-package.R | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/R/pc-package.R b/R/pc-package.R index 6bfd8d3..cbbf396 100644 --- a/R/pc-package.R +++ b/R/pc-package.R @@ -1,10 +1,10 @@ -.onLoad = \(...) { - requireNamespace("Rcpp", quietly = TRUE) -} - -utils::globalVariables(".data") - ## usethis namespace: start #' @useDynLib pc, .registration = TRUE ## usethis namespace: end NULL + +utils::globalVariables(".data") + +.onLoad = \(...) { + requireNamespace("Rcpp", quietly = TRUE) +}