hi James,
this is a nasty interaction between R apply() and the laziness of lazynut.
In attachment a minimal R script to be executed within lazynut, so R << source it.
The dataframe df is created by using R commands. Soon after its content is available to R, but for lazynut it is still empty or not depending on whether the instructions are within a for loop or an apply() command.
Please un/comment the two different versions and check that in the apply version df exists but it's still empty.
This creates me quite some problems, since I am writing rather parameteric scripts where I don't know in advance how many params I need to loop through, so I need apply() and not a set of nested for loops. It would be really nice to have this corrected, if possible. Many thanks!
Hi,
I haven't tried the test, but it sounds like the issue is R local/global surprise syntax, not lazyNut lazyness.
The assignment to eN["df"] is within function braces, so I suspect it occurs to a local copy of eN, not the global one that lazyNut cares about.
eN["df"] <<- blah
is the syntax for global eN.
you are right -- damn it, I spent an afternoon on this.
I have to study this <<- better, have overlooked it so far.
Thanks for the quick reply!
M
On 26 January 2017 at 18:57, James S. Adelman jsadelman@users.sf.net wrote:
--
Dr Michele Gubian
Research Associate
School of Experimental Psychology
Office 3D3
The Priory Road Complex,
Priory Road, Clifton BS8 1TU
Bristol, UK
mm14722@bristol.ac.uk
Related
Tickets:
#177apparently, this is the bad way to use <<-
http://stackoverflow.com/questions/5785290/what-is-the-difference-between-assign-and-in-r
anyway.. it works
On 26 January 2017 at 19:24, Michele Gubian mm14722@bristol.ac.uk wrote:
--
Dr Michele Gubian
Research Associate
School of Experimental Psychology
Office 3D3
The Priory Road Complex,
Priory Road, Clifton BS8 1TU
Bristol, UK
mm14722@bristol.ac.uk
assign is verbose, though. I think it only matters if there's a risk someone will have a local eN in an intermediate closure. Anyone who has that is already going to be very very sad.
The <<- vs. <- thing also sent Colin mad about a year ago (though I don't think that had to do with eN).