|
1 | | -#' @name qenv-inheritted |
2 | | -#' @rdname qenv |
3 | | -#' |
4 | | -#' @details |
5 | | -#' |
6 | | -#' `x[[name]]`, `x$name` and `get(name, x)` are generic \R operators to access the objects in the environment. |
7 | | -#' See [`[[`] for more details. |
8 | | -#' `names(x)` calls on the `qenv` object and will list all objects in the environment. |
9 | | -#' |
10 | | -#' @return `[[`, `$` and `get` return the value of the object named `name` in the `qenv` object. |
11 | | -#' @return `names` return a character vector of all the names of the objects in the `qenv` object. |
12 | | -#' @return `ls` return a character vector of the names of the objects in the `qenv` object. |
13 | | -#' It will only show the objects that are not named with a dot prefix, unless |
14 | | -#' the `all.names = TRUE`, which will show all objects. |
15 | | -#' |
16 | | -#' @examples |
17 | | -#' # Extract objects from qenv |
18 | | -#' q[["a"]] |
19 | | -#' q$a |
20 | | -#' |
21 | | -#' # list objects in qenv |
22 | | -#' names(q) |
23 | | -NULL |
24 | | - |
25 | 1 | #' Get code from `qenv` |
26 | 2 | #' |
27 | | -#' @details |
28 | | -#' `get_code()` retrieves the code stored in the `qenv`. `...` passes arguments to methods. |
| 3 | +#' @description |
| 4 | +#' Retrieves the code stored in the `qenv`. |
29 | 5 | #' |
30 | 6 | #' @param object (`qenv`) |
31 | 7 | #' @param deparse (`logical(1)`) flag specifying whether to return code as `character` or `expression`. |
32 | | -#' @param ... see `Details` |
33 | | -#' |
| 8 | +#' @param ... internal usage, please ignore. |
| 9 | +#' @param names (`character`) `r lifecycle::badge("experimental")` vector of object names to return the code for. |
| 10 | +#' For more details see the "Extracting dataset-specific code" section. |
34 | 11 | #' |
35 | | -#' @section Subsetting by the `names`: |
| 12 | +#' @section Extracting dataset-specific code: |
36 | 13 | #' |
37 | | -#' `get_code(x, names)` limits the returned code to contain only those lines needed to _create_ |
| 14 | +#' `get_code(object, names)` limits the returned code to contain only those lines needed to _create_ |
38 | 15 | #' the requested objects. The code stored in the `qenv` is analyzed statically to determine |
39 | 16 | #' which lines the objects of interest depend upon. The analysis works well when objects are created |
40 | 17 | #' with standard infix assignment operators (see `?assignOps`) but it can fail in some situations. |
|
99 | 76 | #' - creating and evaluating language objects, _e.g._ `eval(<call>)` |
100 | 77 | #' |
101 | 78 | #' @return |
102 | | -#' `get_code` returns the traced code in the form specified by `deparse`. |
| 79 | +#' Returns the traced code in the form specified by `deparse`. |
103 | 80 | #' |
104 | 81 | #' @examples |
105 | 82 | #' # retrieve code |
|
115 | 92 | #' q <- eval_code(q, code = c("a <- 1", "b <- 2")) |
116 | 93 | #' get_code(q, names = "a") |
117 | 94 | #' |
118 | | -#' @name get_code |
119 | | -#' @rdname qenv |
120 | 95 | #' @aliases get_code,qenv-method |
121 | 96 | #' @aliases get_code,qenv.error-method |
122 | 97 | #' |
|
0 commit comments