Skip to content

Commit

Permalink
fix note
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelru committed Feb 13, 2023
1 parent d74eb7e commit 7cd04fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion R/stream_filter.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ stream_filter <- function(slref = NULL, anl = NULL, filters, suffix, slref_keep
silent = TRUE
)

if ("try-error" %in% class(new_df)) {
if (is(new_df, "try-error")) {
# failed - retain original dataset
warning(paste("\nFilter ID=", this_filter, "was NOT applied.", msg1, "\n Error message:", new_df))
cat(paste("\nFilter ID=", this_filter, "was NOT applied.", msg1, "\n Error message:", new_df))
Expand Down
6 changes: 3 additions & 3 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ grobs2pdf <- function(grobs,
logtext <- paste(mget(ls(pattern = "log")), collapse = "\n")

## Make the grobs
if (class(grobs) != "list") {
if (!is.list(grobs)) {
grobs <- list(grobs)
}

Expand Down Expand Up @@ -336,9 +336,9 @@ grob_part <- function(gplot_grob, part) {
grob_parts <- function(gplot, parts) {
stopifnot("gplot must inherit from class 'ggplot' or 'grob'" = inherits(gplot, c("ggplot", "grob")))

if ("ggplot" %in% class(gplot)) {
if (is(gplot, "ggplot")) {
gplot_grob <- ggplotGrob(gplot)
} else if ("grob" %in% class(gplot)) {
} else if (is(gplot, "grob")) {
gplot_grob <- gplot
}
ret <- lapply(parts, grob_part, gplot = gplot_grob)
Expand Down

0 comments on commit 7cd04fa

Please sign in to comment.