Skip to content
Prev 366823 / 398502 Next

No visible binding for global variable

Dear Jamil,

Presumably, the variables alloc.dose, r0, r1, and r2 will exist in the global environment when you call the compiled function lf1.c(), but didn?t exist when you compiled the function. If so, then lf1.c() should work properly despite the notes (not errors, or even warnings) that was printed.

On the other hand, relying on global data in a function is poor programming style ? it would be better to make alloc.dose, etc., arguments to the function. As well, if you?re compiling the function to improve efficiency, then you probably also want to compile psi0(), etc.

I hope that this helps,
 John

John Fox
Sen. William McMaster Professor of Social Statistics
McMaster University
Hamilton, Ontario, Canada
Web: http::/socserv.mcmaster.ca/jfox