Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Tweak two Rd titles

  • Loading branch information...
commit 9770bd80053f2bbd4c3e8accfdba9a8c5c5305fc 1 parent 4e02081
@jcheng5 jcheng5 authored
Showing with 15 additions and 10 deletions.
  1. +7 −5 R/utils.R
  2. +1 −1  man/exprToFunction.Rd
  3. +7 −4 man/installExprFunction.Rd
View
12 R/utils.R
@@ -123,7 +123,7 @@ makeFunction <- function(args = pairlist(), body, env = parent.frame()) {
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
#' an unquoted expression from two calls back.
@@ -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
#' debug hooks so that breakpoints may be set in the function.
#'
@@ -212,8 +214,8 @@ exprToFunction <- function(expr, env=parent.frame(2), quoted=FALSE,
#' \code{installExprFunction(expr, "func")} if we do. Both approaches create a
#' function named \code{func} in the current environment.
#'
-#' @seealso Wraps \code{exprToFunction}; see that method's documentation for
-#' more documentation and examples.
+#' @seealso Wraps \code{\link{exprToFunction}}; see that method's documentation
+#' for more documentation and examples.
#'
#' @param expr A quoted or unquoted expression
#' @param name The name the function should be given
@@ -221,8 +223,8 @@ exprToFunction <- function(expr, env=parent.frame(2), quoted=FALSE,
#' calling environment two steps back.
#' @param quoted Is the expression quoted?
#' @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
-#' to the name of the calling function.
+#' @param label A label for the object to be shown in the debugger. Defaults to
+#' the name of the calling function.
#'
#' @export
installExprFunction <- function(expr, name, eval.env = parent.frame(2),
View
2  man/exprToFunction.Rd
@@ -1,7 +1,7 @@
% Generated by roxygen2 (4.0.0): do not edit by hand
\name{exprToFunction}
\alias{exprToFunction}
-\title{Convert an expression or quoted expression to a function}
+\title{Convert an expression to a function}
\usage{
exprToFunction(expr, env = parent.frame(2), quoted = FALSE,
caller_offset = 1)
View
11 man/installExprFunction.Rd
@@ -1,8 +1,7 @@
% Generated by roxygen2 (4.0.0): do not edit by hand
\name{installExprFunction}
\alias{installExprFunction}
-\title{Installs an expression in the given environment as a function, and registers
-debug hooks so that breakpoints may be set in the function.}
+\title{Install an expression as a function}
\usage{
installExprFunction(expr, name, eval.env = parent.frame(2), quoted = FALSE,
assign.env = parent.frame(1), label = as.character(sys.call(-1)[[1]]))
@@ -24,13 +23,17 @@ installExprFunction(expr, name, eval.env = parent.frame(2), quoted = FALSE,
debugger. Defaults to the name of the calling function.}
}
\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
\code{func <- exprToFunction(expr)} if we do not want the debug hooks, or
\code{installExprFunction(expr, "func")} if we do. Both approaches create a
function named \code{func} in the current environment.
}
\seealso{
-Wraps \code{exprToFunction}; see that method's documentation for
- more documentation and examples.
+Wraps \code{\link{exprToFunction}}; see that method's documentation
+ for more documentation and examples.
}
Please sign in to comment.
Something went wrong with that request. Please try again.