The R Project SVN R

Rev

Rev 54787 | Rev 56184 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 54787 Rev 54801
Line -... Line 1...
-
 
1
% File src/library/utils/man/removeSource.Rd
-
 
2
% Part of the R package, http://www.R-project.org
-
 
3
% Copyright 2011 R Core Development Team
-
 
4
% Distributed under GPL 2 or later
-
 
5
 
1
\name{removeSource}
6
\name{removeSource}
2
\alias{removeSource}
7
\alias{removeSource}
3
\title{
8
\title{
4
Remove stored source from a function.
9
  Remove Stored Source from a Function.
5
}
10
}
6
\description{
11
\description{
7
When \code{options("keep.source")} is \code{TRUE}, 
12
  When \code{options("keep.source")} is \code{TRUE}, a copy of the
8
a copy of the original source code to a function is stored with it.  This function
13
  original source code to a function is stored with it.  This function
9
removes that copy.
14
  removes that copy.
10
}
15
}
11
\usage{
16
\usage{
12
removeSource(fn)
17
removeSource(fn)
13
}
18
}
14
\arguments{
19
\arguments{
15
  \item{fn}{
20
  \item{fn}{
16
A single function from which to remove the source.
21
    A single function from which to remove the source.
17
}
22
  }
18
}
23
}
19
\details{
24
\details{
20
This removes both the \code{"source"} attribute (from \R version 2.13.x or earlier)
25
  This removes both the \code{"source"} attribute (from \R version
21
and the \code{"srcref"} and related attributes.
26
  2.13.x or earlier) and the \code{"srcref"} and related attributes.
22
}
27
}
23
\value{
28
\value{
24
A copy of the function with the source removed.
29
  A copy of the function with the source removed.
25
}
30
}
26
\seealso{
31
\seealso{
27
\code{\link{srcref}} for a description of source reference records, \code{\link{deparse}}
32
  \code{\link{srcref}} for a description of source reference records,
28
for a description of how functions are deparsed.
33
  \code{\link{deparse}} for a description of how functions are deparsed.
29
}
34
}
30
\examples{
35
\examples{
31
fn <- function(x) {
36
fn <- function(x) {
32
  x + 1 # A comment, kept as part of the source
37
  x + 1 # A comment, kept as part of the source
33
}
38
}
34
fn
39
fn
35
fn <- removeSource(fn)
40
fn <- removeSource(fn)
36
fn
41
fn
37
}
42
}
38
\keyword{ utility }
43
\keyword{ utility }