Skip to content

Commit

Permalink
fix note on using class(...) ==...
Browse files Browse the repository at this point in the history
  • Loading branch information
jbkunst committed Aug 7, 2022
1 parent ed30be9 commit 17d5936
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -51,7 +51,8 @@ Imports:
lubridate,
yaml,
rlang (>= 0.1.1),
rjson
rjson,
methods
Suggests:
knitr,
rmarkdown,
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 4 additions & 3 deletions R/highcharts-api-helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -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(...)
Expand All @@ -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(...)
Expand All @@ -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(...)
Expand Down

0 comments on commit 17d5936

Please sign in to comment.