diff --git a/NAMESPACE b/NAMESPACE index 75ec767..85c16cd 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -73,4 +73,5 @@ importFrom(grDevices,colors) importFrom(grDevices,rgb) importFrom(graphics,layout) importFrom(scales,seq_gradient_pal) +importFrom(utils,assignInMyNamespace) importFrom(utils,head) diff --git a/R/ggthemr_current.R b/R/ggthemr_current.R index 3e5c4d5..b1a492d 100644 --- a/R/ggthemr_current.R +++ b/R/ggthemr_current.R @@ -1,7 +1,9 @@ +themr <- NULL + #' @title Store Theme #' @description Store ggthemr theme. +#' @importFrom utils assignInMyNamespace ggthemr_current <- (function () { - themr <- NULL list( get = function () { if (is.null(themr)) { @@ -12,13 +14,15 @@ ggthemr_current <- (function () { }, set = function (value) { verify_ggthemr(value) - themr <<- value + assignInMyNamespace('themr', value) + # themr <<- value }, is_set = function () { !is.null(themr) }, clear = function () { - themr <<- NULL + assignInMyNamespace('themr', NULL) + # themr <<- NULL } ) })()