Stavros Macrakis wrote:
> On Tue, Mar 31, 2009 at 3:41 PM, Wacek Kusnierczyk <
> waclaw.marcin.kusnierc...@idi.ntnu.no> wrote:
>
>
>> Stavros Macrakis wrote:
>>
>>> ...All that being said, programming with global variables makes certain
>>>
>> classes of bug much more likely
>>
>
On Tue, Mar 31, 2009 at 3:41 PM, Wacek Kusnierczyk <
waclaw.marcin.kusnierc...@idi.ntnu.no> wrote:
> Stavros Macrakis wrote:
> > ...All that being said, programming with global variables makes certain
> classes of bug much more likely
>
> ... in a language like r, that heavily relies on settin
Wacek Kusnierczyk wrote:
>
> this is where multiple assignment might be your friend:
>
> source('http://miscell.googlecode.com/svn/rvalues/rvalues.r')
> c(foo, bar, gee) := local({
> shared = 0
> foo = function() shared <<- 0
> bar = function(bar) shared <<- bar
>
Stavros Macrakis wrote:
> On Tue, Mar 31, 2009 at 7:10 AM, wrote:
>
>
>> I need to allocate (using C nomenclature) a set of "global" variables, some
>> integer scalars and some double vectors.
>> ...
>>
>
> My question is: how can I have R interpreter allocate "global"variables
>
>> vis
On Tue, Mar 31, 2009 at 7:10 AM, wrote:
> I need to allocate (using C nomenclature) a set of "global" variables, some
> integer scalars and some double vectors.
> ...
My question is: how can I have R interpreter allocate "global"variables
> visible and accessible by all the functions in the same
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi,
A) you should give and return the variables through input/output
parameter of the functions, e.g.
pwtset <- function(n, inout) {
if (n < 100){
inout$ncof <- n
} else {
inout$ncof <- n -100
}
...
return(inout)
}
ford <- function
I need to allocate (using C nomenclature) a set of "global" variables, some
integer scalars and some double vectors.
I have placed the name of such variables in the file containing the main script
and the called functions:
# --
7 matches
Mail list logo