From ff7b5ba7d998ba50e927f205283ef9ab9d391531 Mon Sep 17 00:00:00 2001 From: pvictor Date: Thu, 3 Dec 2020 10:33:20 +0100 Subject: [PATCH] unlist facet label --- R/facets.R | 7 +++++-- man/ax_facet_wrap.Rd | 9 ++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/R/facets.R b/R/facets.R index 6f1cb41..2f85cdc 100644 --- a/R/facets.R +++ b/R/facets.R @@ -7,7 +7,10 @@ get_facets <- function(data, vars) { X = seq_along(facets), FUN = function(i) { facet <- facets[[i]] - attr(facet, "keys") <- strsplit(x = names(facets)[i], split = "|__|", fixed = TRUE) + attr(facet, "keys") <- strsplit( + x = names(facets)[i], + split = "|__|", fixed = TRUE + )[[1]] facet } ) @@ -94,7 +97,7 @@ ax_facet_wrap <- function(ax, vars, nrow = NULL, ncol = NULL, - labeller = ggplot2::label_value, + labeller = label_value, chart_height = "300px") { if (!inherits(ax, "apex")) stop("ax_facet_wrap only works with charts generated with apex()", call. = FALSE) diff --git a/man/ax_facet_wrap.Rd b/man/ax_facet_wrap.Rd index da532fd..5d6f899 100644 --- a/man/ax_facet_wrap.Rd +++ b/man/ax_facet_wrap.Rd @@ -4,7 +4,14 @@ \alias{ax_facet_wrap} \title{Facet wrap for ApexCharts} \usage{ -ax_facet_wrap(ax, vars, nrow = NULL, ncol = NULL, chart_height = "300px") +ax_facet_wrap( + ax, + vars, + nrow = NULL, + ncol = NULL, + labeller = label_value, + chart_height = "300px" +) } \arguments{ \item{ax}{An \code{apexcharts} \code{htmlwidget} object.}