From c7e42ae40dfa4433d816be77de35b79bcf94e4c8 Mon Sep 17 00:00:00 2001 From: Richard Iannone Date: Fri, 4 Mar 2022 10:43:45 -0500 Subject: [PATCH 1/2] Increment version number to 1.0.9 --- DESCRIPTION | 2 +- NEWS.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 89540bd1..e3aa944b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: DiagrammeR Title: Graph/Network Visualization -Version: 1.0.8.9000 +Version: 1.0.9 Authors@R: person("Richard", "Iannone", , "riannone@me.com", c("aut", "cre"), comment = c(ORCID = "0000-0003-3925-190X")) diff --git a/NEWS.md b/NEWS.md index 5cb1a4ab..76e8fdb5 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# DiagrammeR (development version) +# DiagrammeR 1.0.9 * More safely check inputs to `grViz()` and `mermaid()` From 6964ec77f2773db82d38d220189f5b022f8d4c00 Mon Sep 17 00:00:00 2001 From: Richard Iannone Date: Fri, 4 Mar 2022 11:19:27 -0500 Subject: [PATCH 2/2] Fix various class-checking statements --- R/count_graphs_in_graph_series.R | 2 +- R/filter_graph_series.R | 4 ++-- R/set_graph_time.R | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/count_graphs_in_graph_series.R b/R/count_graphs_in_graph_series.R index 64f658c0..a70e5018 100644 --- a/R/count_graphs_in_graph_series.R +++ b/R/count_graphs_in_graph_series.R @@ -40,7 +40,7 @@ #' @export count_graphs_in_graph_series <- function(graph_series) { - if (class(graph_series) == "dgr_graph_1D") { + if (inherits(graph_series, "dgr_graph_1D")) { if (is.null(graph_series$graphs)) { return(0) } diff --git a/R/filter_graph_series.R b/R/filter_graph_series.R index 75e60878..cff5084f 100644 --- a/R/filter_graph_series.R +++ b/R/filter_graph_series.R @@ -92,7 +92,7 @@ filter_graph_series <- function(graph_series, if (by == "number") { # validate the value provided for 'values' - if (class(values) != "numeric") { + if (!inherits(values, "numeric")) { return(graph_series) } @@ -123,7 +123,7 @@ filter_graph_series <- function(graph_series, if (by == "time") { # validate the value provided for 'values' - if (class(values) == "numeric") { + if (inherits(values, "numeric")) { return(graph_series) } diff --git a/R/set_graph_time.R b/R/set_graph_time.R index f63966c9..05b554a3 100644 --- a/R/set_graph_time.R +++ b/R/set_graph_time.R @@ -55,7 +55,7 @@ set_graph_time <- function(graph, tz <- Sys.timezone() } - if (class(time)[1] == "POSIXct") { + if (inherits(time[1], "POSIXct")) { if (!is.null(attr(time, "tzone"))) { tz <- attr(time, "tzone")