The R Project SVN R

Rev

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

Rev 75380 Rev 75381
Line 75... Line 75...
75
}
75
}
76
\examples{
76
\examples{
77
fil <- tempfile()
77
fil <- tempfile()
78
## Write an ASCII version of the 'base' function mean() to our temp file, ..
78
## Write an ASCII version of the 'base' function mean() to our temp file, ..
79
dput(base::mean, fil)
79
dput(base::mean, fil)
80
## ... read it back into 'bar' and confirm it is the same 
80
## ... read it back into 'bar' and confirm it is the same
81
bar <- dget(fil)
81
bar <- dget(fil)
82
stopifnot(all.equal(bar, base::mean))
82
stopifnot(all.equal(bar, base::mean))
-
 
83
 
83
## Create a function with comments
84
## Create a function with comments
84
baz <- function(x) {
85
baz <- function(x) {
85
  # Subtract from one
86
  # Subtract from one
86
  1-x
87
  1-x
87
}
88
}