[R] Passing parameters in a user defined function to another function using ...

2013-11-18 Thread Lopez, Dan
Hi R Experts, How do you get the ... to work in a user-defined function such as the one I have below? For example if I want to pass replace=TRUE to the sample function. # This is a sample function that generates x rows of z numbers out of y. Basically a lottery style data set.

Re: [R] Passing parameters in a user defined function to another function using ...

2013-11-18 Thread Lopez, Dan
] Sent: Monday, November 18, 2013 6:00 PM To: Lopez, Dan Cc: R help (r-help@r-project.org) Subject: Re: [R] Passing parameters in a user defined function to another function using ... Hi, It's easy, just carry the arguments in '...' forward to where you expect to pass them along. mynumbs

Re: [R] Passing parameters in a user defined function to another function using ...

2013-11-18 Thread Richard M. Heiberger
numbs - rbind(numbs, sort(sample(y, z, ... ))) See ?Reserved which sends you to 'Introduction to R' Rich On Mon, Nov 18, 2013 at 8:52 PM, Lopez, Dan lopez...@llnl.gov wrote: Hi R Experts, How do you get the ... to work in a user-defined function such as the one I have below? For example

Re: [R] Passing parameters in a user defined function to another function using ...

2013-11-18 Thread Ben Tupper
Hi, It's easy, just carry the arguments in '…' forward to where you expect to pass them along. mynumbs-function(x,y,z=5,...){ numbs-sort(sample(y,z, ...)) for (i in 1:(x-1)) numbs-rbind(numbs,sort(sample(y,z, ...))) print(numbs) } Cheers, Ben On Nov 18, 2013, at 8:52 PM, Lopez, Dan

Re: [R] Passing parameters

2011-11-12 Thread ftonini
Hi Annie, The error is in the R script...you start reading with Args[1] but instead you should start with Args[5] etc. because (I believe) that R --slave --vanilla --args count as [1] [2][3][4] Therefore, Args[5] it's the first argument you

Re: [R] Passing parameters

2011-08-25 Thread Scott
Hi Annie, while I don't use python, I've been in similar positions. here's a good link for the arguments function. It's the best example/tutorial I've seen on the topic. It will also help you perhaps to print the values of the arguments to screen/file within R to see if things are going okay.

[R] Passing parameters

2011-08-23 Thread aelmore
Hi, I've got an R script that I'm trying to turn into a ArcGis script tool so that I can run it from ModelBuilder in Arc. Arc isn't giving me any errors when I run the model holding the current tool, but the run time for the R script is 0 seconds. I don't know if the parameters aren't being

[R] Passing parameters to R script in Rgui

2009-03-27 Thread Daren Tan
How do I pass parameters to R script in Rgui ? Currently, I am using source(foo.R). Thanks __ 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

Re: [R] Passing parameters to R script in Rgui

2009-03-27 Thread Bert Gunter
] On Behalf Of Daren Tan Sent: Friday, March 27, 2009 8:45 AM To: r-help@r-project.org Subject: [R] Passing parameters to R script in Rgui How do I pass parameters to R script in Rgui ? Currently, I am using source(foo.R). Thanks __ R-help@r-project.org mailing

[R] passing parameters to an R script

2009-01-03 Thread mauede
I knowf R functions ca be called passing some parameters. My first question is: how are parameters passed to R functions ? Browsing through R archives I found an answer confirming taht parameters can be passed to the called function by value. I wonder whether passing the parameter address is

Re: [R] passing parameters to an R script

2009-01-03 Thread jim holtman
No you can not pass an address to a function. If you want to change the value of something, then return it as a value and assign it to the object so you can see what is going on. Must be coming from the C environment where such things are allowed and lead to a number of problems. If you really

Re: [R] passing parameters to an R script

2009-01-03 Thread Stavros Macrakis
R's variable passing mechanism is not call by value, but a mixture of unevaluated arguments (like the obsolete Lisp FEXPR) and call-by-need. It is like FEXPR in that the function can capture the unevaluated argument (using 'substitute'). But it is like call-by-need in that normal use of the

[R] R: passing parameters to an R script

2009-01-03 Thread mauede
...@alice.it Cc: r-h...@stat.math.ethz.ch; r-help@r-project.org Oggetto: Re: [R] passing parameters to an R script No you can not pass an address to a function. If you want to change the value of something, then return it as a value and assign it to the object so you can see what is going on. Must

Re: [R] R: passing parameters to an R script

2009-01-03 Thread jim holtman
holtman [mailto:jholt...@gmail.com] Inviato: sab 03/01/2009 21.12 A: mau...@alice.it Cc: r-h...@stat.math.ethz.ch; r-help@r-project.org Oggetto: Re: [R] passing parameters to an R script No you can not pass an address to a function. If you want to change the value of something, then return