File: Fdebug.Rd

package info (click to toggle)
hmisc 5.2-4-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,044 kB
  • sloc: asm: 28,905; f90: 590; ansic: 415; xml: 160; fortran: 75; makefile: 2
file content (38 lines) | stat: -rw-r--r-- 1,309 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Fdebug.r
\name{Fdebug}
\alias{Fdebug}
\title{Debug Printing Function Generator}
\usage{
Fdebug(opt)
}
\arguments{
\item{opt}{character string containing an option name}
}
\value{
a function
}
\description{
Takes the name of a system \code{options(opt=)} and checks to see if option \code{opt} is
set to \code{TRUE}, taking its default value to be \code{FALSE}.  If \code{TRUE}, a function is
created that calls \code{\link[=prn]{prn()}} to print an object with the object's name in the
description along with the option name and the name of the function within which
the generated function was called, if any.  If option \code{opt} is not set, a dummy function
is generated instead.  If \code{options(debug_file=)} is set when the generated function
is called, \code{\link[=prn]{prn()}} output will be appended to that file name instead of the console.
At any time, set \code{options(debug_file='')} to resume printing to the console.
}
\examples{
dfun <- Fdebug('my_option_name')   # my_option_name not currently set
dfun
dfun(sqrt(2))
options(my_option_name=TRUE)
dfun <- Fdebug('my_option_name')
dfun
dfun(sqrt(2))
# options(debug_file='/tmp/z') to append output to /tmp/z
options(my_option_name=NULL)
}
\author{
Fran Harrell
}