Re: [R] reporting multiple objects out of a function

2011-10-07 Thread andrewH
Thanks, Gabor! When a beginner (like myself) asks a question, it seems that the thing that we believe we are confused about, or want to learn, may not be the thing that would actually help us the most if it were clearly understood. Your response is what I consider ideal: Answer my question,

Re: [R] reporting multiple objects out of a function

2011-10-07 Thread Rolf Turner
On 07/10/11 19:28, andrewH wrote: (In response to a post by Gabor Grothendieck) SNIP Your response is what I consider ideal: Answer my question, then tell me the answer to the question that I would ask if I were smart enough. SNIP Fortune nomination! cheers, Rolf Turner

Re: [R] reporting multiple objects out of a function

2011-10-07 Thread Prof Brian Ripley
I am baffled as to why so many people think this is the address of the maintainers of the 'fortunes' package. maintainer('fortunes') [1] Achim Zeileis achim.zeil...@r-project.org says otherwise (if you have it installed). Things do get very easily buried in the volume of mail of R-help: it

Re: [R] reporting multiple objects out of a function

2011-10-06 Thread Paul Hiemstra
On 10/05/2011 09:14 PM, andrewH wrote: Thanks, Sina! This is very helpful and informative, but still not quite what I want. So, here is the thing: When a function returns an object, that object is available in the calling environment. If it is returned inside a function, it is available in

Re: [R] reporting multiple objects out of a function

2011-10-05 Thread Paul Hiemstra
On 10/05/2011 04:27 AM, andrewH wrote: Dear folks, I’m trying to build a function to create and make available some variables I frequently use for testing purposes. Suppose I have a function that takes some inputs and creates (internally) several named objects. Say, fun1 - function(x, y,

Re: [R] reporting multiple objects out of a function

2011-10-05 Thread andrewH
Thanks for the response, Paul! But I thought these dumped the variables into the global environment. Is that not correct? I want to make them available in the calling environment, without making them available in the global environment, unless that is where the function is called. This is my bow

Re: [R] reporting multiple objects out of a function

2011-10-05 Thread sina rueeger
Hi Andrew I am not sure if I understood your question entirely. You want to store some objects, but not in the global environment. Correct?! I would do it like this (although I am sure that there is a more elegant way to do this). ##

Re: [R] reporting multiple objects out of a function

2011-10-05 Thread andrewH
Thanks, Sina! This is very helpful and informative, but still not quite what I want. So, here is the thing: When a function returns an object, that object is available in the calling environment. If it is returned inside a function, it is available in the function, but not outside of the

Re: [R] reporting multiple objects out of a function

2011-10-05 Thread Gabor Grothendieck
On Wed, Oct 5, 2011 at 12:27 AM, andrewH ahoer...@rprogress.org wrote: Dear folks, I’m trying to build a function to create and make available some variables I frequently use for testing purposes.  Suppose I have a function that takes some inputs and creates (internally) several named