Skip to content

Commit

Permalink
non-strict examples
Browse files Browse the repository at this point in the history
fix strict default
  • Loading branch information
JohnMount committed Mar 24, 2017
1 parent e3d20bc commit 95ce4b4
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 4 deletions.
8 changes: 8 additions & 0 deletions R/atblock.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
#' )
#' print(res)
#'
#' # larger example
#' c3 <- 4:8
#' terms <- paste(c('c1', 'c2', 'c3'), collapse = ' + ')
#' print(ateval('@terms'))
#'
#' @export
#'
Expand Down Expand Up @@ -92,6 +96,10 @@ ateval <- function(.) {
#' )
#' print(res)
#'
#' # larger example
#' c3 <- 4:8
#' terms <- paste(c('c1', 'c2', 'c3'), collapse = ' + ')
#' print(beval((!!terms)))
#'
#' @export
#'
Expand Down
7 changes: 5 additions & 2 deletions R/let.R
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,14 @@ letprep <- function(alias, strexpr, strict) {
#'
#' # let works by string substitution aligning on word boundaries,
#' # so it does (unfortunately) also re-write strings.
#' let(list(x='y'),'x')
#' let(list(x='y'), 'x')
#'
#' # let can also substitute arbitrary expressions if strict=FALSE
#' let(list(e='1+3'), e, strict= FALSE)
#'
#' @export
let <- function(alias, expr,
strict= FALSE) {
strict= TRUE) {
# try to execute expression in parent environment
# string substitution based implementation
exprS <- letprep(alias, deparse(substitute(expr)),
Expand Down
4 changes: 4 additions & 0 deletions man/ateval.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions man/beval.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions man/let.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 95ce4b4

Please sign in to comment.