PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html<http://www.r-project.org/posting-guide.html>
and provide commented, minimal, self-contained, reproducible code.

You should at least include the function code you are talking about.  A
function will return a value that has to be assigned to an object.
Assignments to local objects in a function disappear (look at 'scoping')
after the function call.  You might have to return a list is there are
multiple values and the in the main program, extract the values from the
list:

> x <- function()list(a=23, b=5)  # return values
> z <- x()  # call the function
> z  # print out z
$a
[1] 23
$b
[1] 5
> z$a
[1] 23
> z$b
[1] 5


On Sat, Feb 20, 2010 at 7:54 PM, hussain abu-saaq <hussain...@hotmail.com>wrote:

>
> hi, I have question. I worte r function that suppsoe ti return x and y to
> me. when I use that function in the middle of a code ( i use source) it give
> me the value of x,y  but when i write x,ro y  it says (not found).
>
>
> so my question is that I want when i load this function to return the
> varibles x and y beuse the rest of my code depends on thse variables.
>
> Thank you
>
> HI
>
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html<http://www.r-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem that you are trying to solve?

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to