Skip to content

Commit ac692b5

Browse files
committed
Fix coverage error
1 parent e5b9a9b commit ac692b5

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

.github/workflows/R-CMD-check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ jobs:
6262
uses: actions/upload-artifact@v7
6363
with:
6464
name: package_tarball
65-
path: check/*.tar.gz
65+
path: check/*.tar.gz

.github/workflows/test-coverage.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ jobs:
4141
with:
4242
# Fail if error if not on PR, or if on PR and token is given
4343
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
44-
file: ./cobertura.xml
45-
plugin: noop
44+
files: ./cobertura.xml
45+
plugins: noop
4646
disable_search: true
4747
token: ${{ secrets.CODECOV_TOKEN }}
4848

R/add_text.r

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
#' @param gp An object of class \code{"gpar"}, this is the graphical parameter
2020
#' settings of the text. See \code{\link[grid]{gpar}}.
2121
#' @param padding Padding of the text, default is \code{unit(1, "mm")}
22-
#' @param parse Logical, behaviour for parsing text as plotmath, see
23-
#' \code{\link[grDevices]{plotmath}}
22+
#' @param parse Logical, behaviour for parsing text as plotmath, see
23+
#' \code{\link[grDevices]{plotmath}}
2424
#'
2525
#' @return A \code{\link[gtable]{gtable}} object.
26-
#' @seealso \code{\link[gtable]{gtable}} \code{\link[grid]{gpar}} \code{\link[grid]{textGrob}}
27-
#' \code{\link[gtable]{gtable_add_grob}}
26+
#' @seealso \code{\link[gtable]{gtable}} \code{\link[grid]{gpar}} \code{\link[grid]{textGrob}}
27+
#' \code{\link[gtable]{gtable_add_grob}}
2828
#' @export
2929
#'
3030
add_text <- function(plot,
@@ -36,7 +36,7 @@ add_text <- function(plot,
3636
gp = gpar(),
3737
padding = unit(1, "mm"),
3838
parse = FALSE){
39-
39+
4040
if(parse)
4141
text <- tryCatch(parse(text = text), error = function(e) text)
4242

@@ -76,7 +76,7 @@ add_text <- function(plot,
7676

7777
# Span to whole plot if col is missing
7878
if(is.null(col))
79-
col <- 2:max(l$r)
79+
col <- min(l$l):max(l$r)
8080
else
8181
col <- 1 + col # Add 1 to account for padding of the plot
8282

R/insert_text.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
#' @param gp An object of class \code{"gpar"}, this is the graphical parameter
2121
#' settings of the text. See \code{\link[grid]{gpar}}.
2222
#' @param padding Padding of the text, default is \code{unit(1, "mm")}
23-
#' @param parse Logical, behaviour for parsing text as plotmath, see
24-
#' \code{\link[grDevices]{plotmath}}
25-
#'
23+
#' @param parse Logical, behaviour for parsing text as plotmath, see
24+
#' \code{\link[grDevices]{plotmath}}
25+
#'
2626
#' @return A \code{\link[gtable]{gtable}} object.
27-
#' @seealso \code{\link[grid]{gpar}} \code{\link[grid]{textGrob}} \code{\link[gtable]{gtable_add_grob}}
27+
#' @seealso \code{\link[grid]{gpar}} \code{\link[grid]{textGrob}} \code{\link[gtable]{gtable_add_grob}}
2828
#' @export
2929
#'
3030
insert_text <- function(plot,
@@ -87,7 +87,7 @@ insert_text <- function(plot,
8787

8888
# Span to whole plot if col is missing
8989
if(is.null(col))
90-
col <- 2:(ncol(plot) - 1)
90+
col <- min(l$l):max(l$l)
9191
else
9292
col <- 1 + col # Add 1 to account for padding of the plot
9393

0 commit comments

Comments
 (0)