Revision: 1697
http://sourceforge.net/p/r-gregmisc/code/1697
Author: warnes
Date: 2013-07-05 23:47:03 +0000 (Fri, 05 Jul 2013)
Log Message:
-----------
Point out that addLast() modifies the value of .Last in the global environment.
Modified Paths:
--------------
trunk/gtools/man/addLast.Rd
Modified: trunk/gtools/man/addLast.Rd
===================================================================
--- trunk/gtools/man/addLast.Rd 2013-07-05 23:34:38 UTC (rev 1696)
+++ trunk/gtools/man/addLast.Rd 2013-07-05 23:47:03 UTC (rev 1697)
@@ -11,20 +11,22 @@
\item{fun}{Function to be called.}
}
\details{
- \code{addLast} defines \code{.Last} (if not already present) or redifines it
- so that the function \code{fun} will be called when R exits. The
- latter is accomplished by saving the current definition of \code{.Last} and
- creating a new \code{.Last} function that calls \code{fun} and then the
- original \code{.Last} function.
+ \code{addLast} defines the \code{.Last} function in the global
+ environment (if not already present) or redifines it so that the
+ function \code{fun} will be called when R exits. The latter is
+ accomplished by saving the current definition of \code{.Last} and
+ creating a new \code{.Last} function that calls \code{fun} and then
+ the original \code{.Last} function.
}
\value{
None.
}
+\note{This function creates/modifies the definition of '.Last' in the
+ global environment.}
\author{Gregory R. Warnes \email{gr...@wa...}}
\seealso{ \code{\link[base]{.Last}} }
\examples{
-\dontrun{
## Print a couple of cute messages when R exits.
helloWorld <- function() cat("\nHello World!\n")
byeWorld <- function() cat("\nGoodbye World!\n")
@@ -32,6 +34,7 @@
addLast(byeWorld)
addLast(helloWorld)
+\dontrun{
q("no")
## Should yield:
@@ -43,6 +46,7 @@
## Goodbye World!
##
## Process R finished at Tue Nov 22 10:28:55 2005
+}
## Unix-flavour example: send Rplots.ps to printer on exit.
myLast <- function()
@@ -52,6 +56,7 @@
cat("bye bye...\n")
}
addLast(myLast)
+\dontrun{
quit("yes")
## Should yield:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|