@Research_Tim p[i] <<- cor.test(...)
-
-
-
(but scoping is your friend; if you do that you will regret it eventually)
1 reply 0 retweets 1 like -
Replying to @richarddmorey @joshdeleeuw
No idea what that means, quick googling suggested it might be way beyond me atm
1 reply 0 retweets 0 likes -
I think he meant "scoping" as in global vs local scope.
1 reply 0 retweets 0 likes -
yes. "<<-" changes a variable that is defined outside the local scope of the function. Can lead to >
1 reply 0 retweets 1 like -
Replying to @richarddmorey @JoeHilgard and
> hard to find bugs where variable values change that you don't expect. Best to define the variable >
1 reply 0 retweets 2 likes -
Replying to @richarddmorey @JoeHilgard and
> inside the function, then return() it.
1 reply 0 retweets 2 likes -
Oooh, got it! This is nice.
1 reply 0 retweets 0 likes -
Replying to @Heinonmatti @JoeHilgard
I agree with
@richarddmorey. Many better ways to solve than global assignment. Quick and dirty fix.1 reply 0 retweets 1 like
The curious person can read http://adv-r.had.co.nz/Environments.html … for details of scoping in R @joshdeleeuw @Heinonmatti @JoeHilgard @richarddmorey
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.