Skip to content

Commit

Permalink
Tweak two Rd titles
Browse files Browse the repository at this point in the history
  • Loading branch information
jcheng5 committed Feb 18, 2014
1 parent 4e02081 commit 9770bd8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
12 changes: 7 additions & 5 deletions R/utils.R
Expand Up @@ -123,7 +123,7 @@ makeFunction <- function(args = pairlist(), body, env = parent.frame()) {
eval(call("function", args, body), env) eval(call("function", args, body), env)
} }


#' Convert an expression or quoted expression to a function #' Convert an expression to a function
#' #'
#' This is to be called from another function, because it will attempt to get #' This is to be called from another function, because it will attempt to get
#' an unquoted expression from two calls back. #' an unquoted expression from two calls back.
Expand Down Expand Up @@ -204,6 +204,8 @@ exprToFunction <- function(expr, env=parent.frame(2), quoted=FALSE,
} }
} }


#' Install an expression as a function
#'
#' Installs an expression in the given environment as a function, and registers #' Installs an expression in the given environment as a function, and registers
#' debug hooks so that breakpoints may be set in the function. #' debug hooks so that breakpoints may be set in the function.
#' #'
Expand All @@ -212,17 +214,17 @@ exprToFunction <- function(expr, env=parent.frame(2), quoted=FALSE,
#' \code{installExprFunction(expr, "func")} if we do. Both approaches create a #' \code{installExprFunction(expr, "func")} if we do. Both approaches create a
#' function named \code{func} in the current environment. #' function named \code{func} in the current environment.
#' #'
#' @seealso Wraps \code{exprToFunction}; see that method's documentation for #' @seealso Wraps \code{\link{exprToFunction}}; see that method's documentation
#' more documentation and examples. #' for more documentation and examples.
#' #'
#' @param expr A quoted or unquoted expression #' @param expr A quoted or unquoted expression
#' @param name The name the function should be given #' @param name The name the function should be given
#' @param eval.env The desired environment for the function. Defaults to the #' @param eval.env The desired environment for the function. Defaults to the
#' calling environment two steps back. #' calling environment two steps back.
#' @param quoted Is the expression quoted? #' @param quoted Is the expression quoted?
#' @param assign.env The environment in which the function should be assigned. #' @param assign.env The environment in which the function should be assigned.
#' @param label A label for the object to be shown in the debugger. Defaults #' @param label A label for the object to be shown in the debugger. Defaults to
#' to the name of the calling function. #' the name of the calling function.
#' #'
#' @export #' @export
installExprFunction <- function(expr, name, eval.env = parent.frame(2), installExprFunction <- function(expr, name, eval.env = parent.frame(2),
Expand Down
2 changes: 1 addition & 1 deletion man/exprToFunction.Rd
@@ -1,7 +1,7 @@
% Generated by roxygen2 (4.0.0): do not edit by hand % Generated by roxygen2 (4.0.0): do not edit by hand
\name{exprToFunction} \name{exprToFunction}
\alias{exprToFunction} \alias{exprToFunction}
\title{Convert an expression or quoted expression to a function} \title{Convert an expression to a function}
\usage{ \usage{
exprToFunction(expr, env = parent.frame(2), quoted = FALSE, exprToFunction(expr, env = parent.frame(2), quoted = FALSE,
caller_offset = 1) caller_offset = 1)
Expand Down
11 changes: 7 additions & 4 deletions man/installExprFunction.Rd
@@ -1,8 +1,7 @@
% Generated by roxygen2 (4.0.0): do not edit by hand % Generated by roxygen2 (4.0.0): do not edit by hand
\name{installExprFunction} \name{installExprFunction}
\alias{installExprFunction} \alias{installExprFunction}
\title{Installs an expression in the given environment as a function, and registers \title{Install an expression as a function}
debug hooks so that breakpoints may be set in the function.}
\usage{ \usage{
installExprFunction(expr, name, eval.env = parent.frame(2), quoted = FALSE, installExprFunction(expr, name, eval.env = parent.frame(2), quoted = FALSE,
assign.env = parent.frame(1), label = as.character(sys.call(-1)[[1]])) assign.env = parent.frame(1), label = as.character(sys.call(-1)[[1]]))
Expand All @@ -24,13 +23,17 @@ installExprFunction(expr, name, eval.env = parent.frame(2), quoted = FALSE,
debugger. Defaults to the name of the calling function.} debugger. Defaults to the name of the calling function.}
} }
\description{ \description{
Installs an expression in the given environment as a function, and registers
debug hooks so that breakpoints may be set in the function.
}
\details{
This function can replace \code{exprToFunction} as follows: we may use This function can replace \code{exprToFunction} as follows: we may use
\code{func <- exprToFunction(expr)} if we do not want the debug hooks, or \code{func <- exprToFunction(expr)} if we do not want the debug hooks, or
\code{installExprFunction(expr, "func")} if we do. Both approaches create a \code{installExprFunction(expr, "func")} if we do. Both approaches create a
function named \code{func} in the current environment. function named \code{func} in the current environment.
} }
\seealso{ \seealso{
Wraps \code{exprToFunction}; see that method's documentation for Wraps \code{\link{exprToFunction}}; see that method's documentation
more documentation and examples. for more documentation and examples.
} }

0 comments on commit 9770bd8

Please sign in to comment.