diff --git a/DESCRIPTION b/DESCRIPTION index 140a6ec9..5f98740b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -26,7 +26,7 @@ Authors@R: c( URL: https://jkunst.com/highcharter/, https://github.com/jbkunst/highcharter BugReports: https://github.com/jbkunst/highcharter/issues License: MIT + file LICENSE -RoxygenNote: 7.1.2 +RoxygenNote: 7.2.1 Roxygen: list(markdown = TRUE) Encoding: UTF-8 Depends: @@ -51,7 +51,8 @@ Imports: lubridate, yaml, rlang (>= 0.1.1), - rjson + rjson, + methods Suggests: knitr, rmarkdown, diff --git a/NAMESPACE b/NAMESPACE index 9a0dedcc..213fd911 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -229,6 +229,7 @@ importFrom(igraph,vertex_attr) importFrom(jsonlite,toJSON) importFrom(lubridate,is.Date) importFrom(magrittr,"%>%") +importFrom(methods,is) importFrom(purrr,map) importFrom(purrr,map2) importFrom(purrr,map_chr) diff --git a/R/highcharts-api-helpers.R b/R/highcharts-api-helpers.R index 30ebc1c6..253d73e2 100644 --- a/R/highcharts-api-helpers.R +++ b/R/highcharts-api-helpers.R @@ -346,10 +346,11 @@ hc_motion <- function(hc, enabled = TRUE, startIndex = 0, ...) { hc } +#' @importFrom methods is #' @rdname hc_add_yAxis #' @export hc_yAxis_multiples <- function(hc, ...) { - if (length(list(...)) == 1 & class(list(...)[[1]]) == "hc_axis_list") { + if (length(list(...)) == 1 & is(list(...)[[1]])[[1]] == "hc_axis_list") { hc$x$hc_opts$yAxis <- list(...)[[1]] } else { hc$x$hc_opts$yAxis <- list(...) @@ -360,7 +361,7 @@ hc_yAxis_multiples <- function(hc, ...) { #' @rdname hc_add_yAxis #' @export hc_xAxis_multiples <- function(hc, ...) { - if (length(list(...)) == 1 & class(list(...)[[1]]) == "hc_axis_list") { + if (length(list(...)) == 1 & is(list(...)[[1]])[[1]] == "hc_axis_list") { hc$x$hc_opts$xAxis <- list(...)[[1]] } else { hc$x$hc_opts$xAxis <- list(...) @@ -371,7 +372,7 @@ hc_xAxis_multiples <- function(hc, ...) { #' @rdname hc_add_yAxis #' @export hc_zAxis_multiples <- function(hc, ...) { - if (length(list(...)) == 1 & class(list(...)[[1]]) == "hc_axis_list") { + if (length(list(...)) == 1 & is(list(...)[[1]])[[1]] == "hc_axis_list") { hc$x$hc_opts$zAxis <- list(...)[[1]] } else { hc$x$hc_opts$zAxis <- list(...)