Skip to content

Commit 1fe8b18

Browse files
committed
docs: small improvements
1 parent 709265f commit 1fe8b18

File tree

7 files changed

+22
-20
lines changed

7 files changed

+22
-20
lines changed

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ S3method(c,qenv)
77
S3method(c,qenv.error)
88
S3method(length,qenv)
99
S3method(length,qenv.error)
10+
S3method(names,qenv.error)
1011
S3method(within,qenv)
1112
S3method(within,qenv.error)
1213
export(concat)

R/qenv-eval_code.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ setMethod("eval_code", signature = c("qenv", "character"), function(object, code
4747
{
4848
eval(single_call, envir = object@.xData)
4949
if (!identical(parent.env(object@.xData), parent.env(.GlobalEnv))) {
50-
# needed to make sure that @env is always a sibling of .GlobalEnv
50+
# needed to make sure that @.xData is always a sibling of .GlobalEnv
5151
# could be changed when any new package is added to search path (through library or require call)
5252
parent.env(object@.xData) <- parent.env(.GlobalEnv)
5353
}

R/qenv-get_env.R

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#' Access environment included in `qenv`
22
#'
3-
#' The access of environment included in `qenv@env` allows to e.g. list object names included in `qenv@env` slot.
3+
#' The access of environment included in the `qenv` that contains all data objects.
44
#'
5-
#' @param object (`qenv`)
5+
#' @param object (`qenv`).
66
#'
7-
#' @return An `environment` stored in `qenv@env` slot.
7+
#' @return An `environment` stored in `qenv` slot with all data objects.
88
#'
99
#' @examples
1010
#' q <- qenv()
@@ -13,7 +13,8 @@
1313
#' b <- data.frame(x = 1:10)
1414
#' })
1515
#' get_env(q1)
16-
#' ls(get_env(q1))
16+
#'
17+
#' ls(get_env(q1)) # list objects in the environment
1718
#'
1819
#' @aliases get_env,qenv-method
1920
#' @aliases get_env,qenv.error-method
@@ -23,10 +24,6 @@ setGeneric("get_env", function(object) {
2324
standardGeneric("get_env")
2425
})
2526

26-
setMethod("get_env", "qenv", function(object) {
27-
object@.xData
28-
})
27+
setMethod("get_env", "qenv", function(object) [email protected])
2928

30-
setMethod("get_env", "qenv.error", function(object) {
31-
object
32-
})
29+
setMethod("get_env", "qenv.error", function(object) object)

R/qenv-get_var.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,14 @@ setMethod("[[", signature = c("qenv", "ANY"), function(x, i) {
5656
))
5757
}
5858

59+
#' @export
60+
names.qenv.error <- function(x) NULL
61+
5962
#' @export
6063
`$.qenv.error` <- function(x, name) {
6164
# Must allow access of elements in qenv.error object (message, call, trace, ...)
6265
# Otherwise, it will enter an infinite recursion with the `conditionMessage(x)` call.
63-
if (name %in% names(x)) {
66+
if (exists(name, x)) {
6467
return(NextMethod("$", x))
6568
}
6669

R/qenv-join.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@
7474
#' # Error message will occur
7575
#'
7676
#' # Check the value of temporary variable i in both objects
77-
#' x@env$i # Output: 2
78-
#' y@env$i # Output: 3
77+
#' x@.xData$i # Output: 2
78+
#' y@.xData$i # Output: 3
7979
#' ```
8080
#' `join()` fails to provide a proper result because of the temporary variable `i` exists
8181
#' in both objects but has different value.

man/get_env.Rd

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/join.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)