Skip to content

Commit 1412973

Browse files
committed
slice alias
1 parent d3a6a70 commit 1412973

File tree

4 files changed

+38
-2
lines changed

4 files changed

+38
-2
lines changed

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ export(install_node_addin)
88
export(open_prefs_addin)
99
export(reconstruct_addin)
1010
export(show_dependencies_addin)
11+
export(slice)
1112
export(slice_addin)

R/slice.R

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,15 @@ get_reconstruction <- function(filename = NULL, code = NULL, criterion = NULL, p
112112
return(code)
113113
}
114114
}
115+
116+
#' Generates a slice for the given filename and criterion, code fragment and criterion, or the currently highlighted variable in the active RStudio document and returns the reconstructed code fragment.
117+
#'
118+
#' @param filename The name of the file to slice. If NULL, the passed code fragment is used.
119+
#' @param code The code fragment to slice, as a character. If also NULL, the currently active document is used.
120+
#' @param criterion The slicing criterion to use. Needs to be non-NULL if filename or code is provided.
121+
#' @param print If TRUE, the reconstructed code is printed to the console and returned invisibly. Defaults to TRUE.
122+
#'
123+
#' @return The reconstructed code fragment for the generated slice.
124+
#'
125+
#' @export
126+
slice <- get_reconstruction

man/get_reconstruction.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.

man/slice.Rd

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

0 commit comments

Comments
 (0)