[R] Some Programming Humor - Quine
Prof Brian Ripley
ripley at stats.ox.ac.uk
Thu May 15 14:17:20 CEST 2003
On Thu, 15 May 2003, Wolfgang Koller wrote:
> By the way, some questions that arose in this programming exercise:
> a) is there a simpler way to do the assignment
> STR <- "\""
> without using quotes?
Not simpler, but '"' is probably easier to read.
> b) what does this cryptic <environment: 034768AC> (or similar) mean that
> does appear after the return value of quine() but not after the result of
All R functions have environments. This is not printed when the function
is printed if and only if the environment is the user's workspace.
The number is a Hex address of the environment, and you will see it when
functions are defined or generated inside functions.
> c) is there a better way to check if two functions are identical than the
> way suggested above?
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-help