| 70405 |
lawrence |
1 |
% File src/library/base/man/debugcall.Rd
|
|
|
2 |
% Part of the R package, https://www.R-project.org
|
|
|
3 |
% Copyright 1995-2016 R Core Team
|
|
|
4 |
% Distributed under GPL 2 or later
|
|
|
5 |
|
|
|
6 |
\name{debugcall}
|
|
|
7 |
\title{Debug a Call}
|
|
|
8 |
\alias{debugcall}
|
|
|
9 |
\alias{undebugcall}
|
|
|
10 |
\usage{
|
|
|
11 |
debugcall(call, once = FALSE)
|
|
|
12 |
undebugcall(call)
|
|
|
13 |
}
|
|
|
14 |
\arguments{
|
|
|
15 |
\item{call}{An R expression calling a function. The called function
|
|
|
16 |
will be debugged. See Details.}
|
|
|
17 |
\item{once}{logical; if \code{TRUE}, debugging only occurs once, as via
|
|
|
18 |
\code{debugonce}. Defaults to \code{FALSE}}
|
|
|
19 |
}
|
|
|
20 |
\description{
|
|
|
21 |
Set or unset debugging flags based on a call to a function. Takes into
|
|
|
22 |
account S3/S4 method dispatch based on the classes of the arguments in
|
|
|
23 |
the call.
|
|
|
24 |
}
|
|
|
25 |
\details{
|
|
|
26 |
\code{debugcall} debugs the non-generic function, S3 method or S4
|
|
|
27 |
method that would be called by evaluating \code{call}. Thus, the user
|
|
|
28 |
does not need to specify the signature when debugging
|
|
|
29 |
methods. Although the call is actually to the generic, it is the
|
|
|
30 |
method that is debugged, not the generic, except for non-standard S3
|
|
|
31 |
generics (see \code{\link{isS3stdGeneric}}).
|
|
|
32 |
}
|
|
|
33 |
\value{
|
|
|
34 |
\code{debugcall} invisibly returns the debugged call expression.
|
|
|
35 |
}
|
|
|
36 |
\note{
|
|
|
37 |
Non-standard evaluation is used to retrieve the \code{call} (via
|
|
|
38 |
\code{\link{substitute}}). For this reason, passing a variable
|
|
|
39 |
containing a call expression, rather than the call expression itself,
|
|
|
40 |
will not work.
|
|
|
41 |
}
|
|
|
42 |
\seealso{
|
|
|
43 |
\code{\link{debug}} for the primary debugging interface
|
|
|
44 |
}
|
|
|
45 |
|
|
|
46 |
\examples{
|
|
|
47 |
\dontrun{
|
|
|
48 |
## Evaluate call after setting debugging
|
|
|
49 |
##
|
|
|
50 |
f <- factor(1:10)
|
|
|
51 |
res <- eval(debugcall(summary(f)))
|
|
|
52 |
}
|
|
|
53 |
}
|
|
|
54 |
\keyword{programming}
|
|
|
55 |
\keyword{environment}
|
|
|
56 |
\keyword{utilities}
|