The R Project SVN R

Rev

Rev 56186 | Rev 68948 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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