RE: [R] getting values out of functions

2004-07-29 Thread Liaw, Andy
From: Kathryn Jones Hi there, Just wondering if there's a way to get a value you've assigned within a function, out of the function? For example, function () { testing -read.table(...,header=TRUE) } I want to be able to use 'testing' outside of the function, so be able

Re: [R] getting values out of functions

2004-07-29 Thread Spencer Graves
Have you looked at writing your own functions in An Introduction to R, downloadable from www.r-project.org - Documentation: Manuals? If you want more than one object, you can return a list with all the objects you want as components; see lists and data frames in the same manual.

Re: [R] getting values out of functions

2004-07-29 Thread Roger D. Peng
You can use assign(), but why do you want to do this? Also, a function always returns the last expression in the function body. Or you can use return(). -roger Kathryn Jones wrote: Hi there, Just wondering if there's a way to get a value you've assigned within a function, out of the