From f9c195245aba4a966156f62005cb812417956c9b Mon Sep 17 00:00:00 2001 From: li ming Date: Mon, 6 Jan 2025 20:20:51 +0800 Subject: [PATCH 1/2] caller check --- DESCRIPTION | 15 ++++++++------- R/insertion.R | 9 +++++++++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index ffd15e4..8c73eaf 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -11,13 +11,14 @@ Description: For many times, we are not just aligning plots as what 'cowplot' an Depends: R (>= 4.1.0) Imports: - ggfun (>= 0.1.3), - ggplot2, - ggplotify, - patchwork, - magrittr, - methods, - utils + ggfun (>= 0.1.3), + ggplot2, + ggplotify, + patchwork, + magrittr, + methods, + utils, + yulab.utils (>= 0.1.9) Suggests: ggtree URL: https://github.com/YuLab-SMU/aplot, https://yulab-smu.top/aplot/ diff --git a/R/insertion.R b/R/insertion.R index 963be19..7049e1b 100644 --- a/R/insertion.R +++ b/R/insertion.R @@ -42,6 +42,9 @@ insert_left <- function(.data, plot, width=1) { ##' @rdname plot-insertion ##' @export insert_right <- function(.data, plot, width=1) { + + yulab.utils:::.crap(n=3L, fn = 'caller function') + insert_lr(.data = .data, plot = plot, width = width, side = "right") } @@ -102,6 +105,9 @@ insert_lr <- function(.data, plot, width, side) { ##' @rdname plot-insertion ##' @export insert_top <- function(.data, plot, height=1) { + + yulab.utils:::.crap(n=3L, fn = 'caller function') + insert_tb(.data = .data, plot = plot, height = height, side = "top") } @@ -110,6 +116,9 @@ insert_top <- function(.data, plot, height=1) { ##' @rdname plot-insertion ##' @export insert_bottom <- function(.data, plot, height=1) { + + yulab.utils:::.crap(n=3L, fn = 'caller function') + insert_tb(.data = .data, plot = plot, height = height, side = "bottom") } From e9485680f0678cd2eb88d4f738c2c9a63a5d8708 Mon Sep 17 00:00:00 2001 From: li ming Date: Mon, 6 Jan 2025 23:06:51 +0800 Subject: [PATCH 2/2] caller check for oncoplot --- R/insertion.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/insertion.R b/R/insertion.R index 7049e1b..e01f2da 100644 --- a/R/insertion.R +++ b/R/insertion.R @@ -43,7 +43,7 @@ insert_left <- function(.data, plot, width=1) { ##' @export insert_right <- function(.data, plot, width=1) { - yulab.utils:::.crap(n=3L, fn = 'caller function') + yulab.utils:::.crap(n=2L, fn = 'oncoplot') insert_lr(.data = .data, plot = plot, width = width, side = "right") @@ -106,7 +106,7 @@ insert_lr <- function(.data, plot, width, side) { ##' @export insert_top <- function(.data, plot, height=1) { - yulab.utils:::.crap(n=3L, fn = 'caller function') + yulab.utils:::.crap(n=2L, fn = 'oncoplot') insert_tb(.data = .data, plot = plot, height = height, side = "top") @@ -117,7 +117,7 @@ insert_top <- function(.data, plot, height=1) { ##' @export insert_bottom <- function(.data, plot, height=1) { - yulab.utils:::.crap(n=3L, fn = 'caller function') + yulab.utils:::.crap(n=2L, fn = 'oncoplot') insert_tb(.data = .data, plot = plot, height = height, side = "bottom")