[R] Maximum recursion depth and unique()

Mark E. Fenner fenner at cs.pitt.edu
Mon Dec 31 01:02:23 CET 2001

Two questions:

First, what is R's maximum recursion depth (for function evaluations)?  Is
the value stored in a variable?  Can the value be modified?

Second, I've hacked out a function to take a matrix (array) of data and
return another that is the same except it removes any duplicate
columns.  After doing this I discovered the unique() function and I tried
to use it via apply() to do the same thing my function
"removeduplicates" did.

The closest I came to something that worked was "apply(t, 1, unique)" and
taking the transpose of this result (t is an 2D array).  This
didn't make sense at first; then I realized that the duplication I 
was looking for was a "row by row" duplication.  I don't
think what I have there will work in the general case.  So, does anyone
know how to use "unique" to remove duplicate columns from a 2D data


r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list