[R] Return one value, print another

Joshua Wiley jwiley.psych at gmail.com
Fri Mar 12 16:08:04 CET 2010


Dieter:

I had considered creating a special class, but you are right that it
was more than I (really) wanted to do.  Setting the global digits
option is an excellent suggestion.  Thank you.  Right now I am working
with simple functions mostly to save myself a few steps.

Miguel:

I did not use print() because I was under the (mistaken) impression
that functions would only return the last expression evaluated or the
contents of return().  So I thought if I used print() it would be
ignored unless it came outside the function, and I did not want to
create global objects.  Also I used a list() just following the
suggestion from the return help page, but I will look at named vectors
also.  So thank you for that idea too.

Thanks again.

Josh


-- 
Joshua Wiley
Senior in Psychology
University of California, Riverside
http://www.joshuawiley.com/



More information about the R-help mailing list