Skip to content

Commit b04d078

Browse files
committed
update documentation of extract_code_graph + extend documentation of qenv with 2 new attributes: side_effects, occurrence
1 parent 291cf10 commit b04d078

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

R/qenv-class.R

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@
1111
#' @section Code:
1212
#'
1313
#' Each code element is a character representing one call. Each element has possible attributes:
14-
#' - warnings (`character`) the warnings output when evaluating the code element
15-
#' - messages (`character`) the messages output when evaluating the code element
16-
#' - id (`integer`) random identifier of the code element to make sure uniqueness when joining.
14+
#' - `warnings` (`character`) the warnings output when evaluating the code element
15+
#' - `messages` (`character`) the messages output when evaluating the code element
16+
#' - `id (`integer`) random identifier of the code element to make sure uniqueness when joining
17+
#' - `side_effects` (`character`) names of objects that gets affected by this code call
18+
#' - `occurrence` (`character`) names of objects that appear in this call, separated by `<-`
19+
#' (objects on LHS of `<-` are affected by this line, and objects on RHS are affecting)
1720
#'
1821
#' @keywords internal
1922
#' @exportClass qenv

R/utils-get_code_dependency.R

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,17 +182,16 @@ sub_arrows <- function(call) {
182182

183183
# code_graph ----
184184

185-
#' Create object dependencies graph within parsed code
185+
#' Create object dependencies graph based on code
186186
#'
187-
#' Builds dependency graph that identifies dependencies between objects in parsed code.
187+
#' Builds dependency graph that identifies dependencies between objects in code.
188188
#' Helps understand which objects depend on which.
189189
#'
190-
#' @param calls_pd `list` of `data.frame`s;
191-
#' result of `utils::getParseData()` split into subsets representing individual calls;
192-
#' created by `extract_calls()` function
190+
#' @param code (`list`) result of `get_code(eval_code(qenv()))`.
191+
#' List containing calls as characters in each element, extended with attributes `occurrence` and `side_effects`.
193192
#'
194193
#' @return
195-
#' A list (of length of input `calls_pd`) where each element represents one call.
194+
#' A list (of length of input `code`) where each element represents one call.
196195
#' Each element is a character vector listing names of objects that depend on this call
197196
#' and names of objects that this call depends on.
198197
#' Dependencies are listed after the `"<-"` string, e.g. `c("a", "<-", "b", "c")` means that in this call object `a`

man/qenv-class.Rd

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

0 commit comments

Comments
 (0)