> Here's something that works. I'm sure there are better solutions (in
> particular the paste part - I couldn't figure out how to avoid typing
> a[i,1], ..., a[i,10]).

This is a language issue that arises frequently. One standard approach is to
use do.call() as in:

... result <- do.call("paste",as.data.frame(yourmatrix), sep="")

The bit to notice here is that the "args" argument to do.call must be a
list, which is why the conversion to a data.frame (which IS a list) is used.

V&R's S PROGRAMMING book discusses this and many related issues in their
"Computing on the Language" chapter. I find it challenging, but invaluable.


-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA
 
"The business of the statistician is to catalyze the scientific learning
process."  - George E. P. Box

______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to