From 1765b1436c62859d7ba9470d6cf3be2ac9652189 Mon Sep 17 00:00:00 2001 From: go_gonzo Date: Fri, 6 Oct 2023 10:35:01 +0200 Subject: [PATCH 1/4] Necessary fixes --- DESCRIPTION | 4 ++-- NAMESPACE | 1 + R/qenv-class.R | 1 + R/qenv-show.R | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index fddcb6004..656496430 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -20,12 +20,12 @@ URL: https://insightsengineering.github.io/teal.code/, https://github.com/insightsengineering/teal.code BugReports: https://github.com/insightsengineering/teal.code/issues Depends: - R (>= 4.0) + R (>= 4.0), + methods Imports: checkmate (>= 2.1.0), grDevices, lifecycle (>= 0.2.0), - methods, rlang (>= 1.1.0), shiny (>= 1.6.0), styler (>= 1.2.0) diff --git a/NAMESPACE b/NAMESPACE index d7211a97c..eeab3cf32 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -10,6 +10,7 @@ export(get_var) export(get_warnings) export(join) export(new_qenv) +exportClasses(qenv) exportMethods("[[") exportMethods(concat) exportMethods(eval_code) diff --git a/R/qenv-class.R b/R/qenv-class.R index a2e603abb..c51a014d4 100644 --- a/R/qenv-class.R +++ b/R/qenv-class.R @@ -11,6 +11,7 @@ #' @slot warnings (`character`) the warnings output when evaluating the code #' @slot messages (`character`) the messages output when evaluating the code #' @keywords internal +#' @exportClass qenv setClass( "qenv", slots = c(env = "environment", code = "expression", id = "integer", warnings = "character", messages = "character"), diff --git a/R/qenv-show.R b/R/qenv-show.R index d295160c1..7d7ea9572 100644 --- a/R/qenv-show.R +++ b/R/qenv-show.R @@ -4,6 +4,7 @@ #' @param object (`qenv`) #' @return nothing #' @importFrom methods show +#' @exportMethod show #' @examples #' q1 <- new_qenv( #' code = "a <- 5 @@ -11,7 +12,6 @@ #' env = list2env(list(a = 5, b = data.frame(x = 1:10))) #' ) #' q1 -#' @export setMethod("show", "qenv", function(object) { rlang::env_print(object@env) }) From 702edc2132ba73eabead129f161dad8b4f39bc3e Mon Sep 17 00:00:00 2001 From: go_gonzo Date: Wed, 18 Oct 2023 09:29:05 +0200 Subject: [PATCH 2/4] update NEWS --- NEWS.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NEWS.md b/NEWS.md index a7a8672b5..285964e28 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,8 @@ # teal.code 0.4.1.9003 +### Miscellaneous + +* Exported the `qenv` class from the package. * The `@code` field in the `qenv` class now holds `character`, not `expression`. # teal.code 0.4.1 From d0069da97c54da1365b04c1d4ad56cf0f56ad790 Mon Sep 17 00:00:00 2001 From: go_gonzo Date: Wed, 18 Oct 2023 09:30:20 +0200 Subject: [PATCH 3/4] replacing exportMethod with export - same effect --- R/qenv-show.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/qenv-show.R b/R/qenv-show.R index 7d7ea9572..8d92f3f85 100644 --- a/R/qenv-show.R +++ b/R/qenv-show.R @@ -4,7 +4,7 @@ #' @param object (`qenv`) #' @return nothing #' @importFrom methods show -#' @exportMethod show +#' @export #' @examples #' q1 <- new_qenv( #' code = "a <- 5 From 6806394c15dd4f7a7f963fd95186ba5f35a7e1f2 Mon Sep 17 00:00:00 2001 From: go_gonzo Date: Wed, 18 Oct 2023 14:07:00 +0200 Subject: [PATCH 4/4] revert to initial --- R/qenv-show.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/qenv-show.R b/R/qenv-show.R index 8d92f3f85..d295160c1 100644 --- a/R/qenv-show.R +++ b/R/qenv-show.R @@ -4,7 +4,6 @@ #' @param object (`qenv`) #' @return nothing #' @importFrom methods show -#' @export #' @examples #' q1 <- new_qenv( #' code = "a <- 5 @@ -12,6 +11,7 @@ #' env = list2env(list(a = 5, b = data.frame(x = 1:10))) #' ) #' q1 +#' @export setMethod("show", "qenv", function(object) { rlang::env_print(object@env) })