David Pain
2007-Jul-27 23:06 UTC
[R] Package manual examples - 'unexpected$undefined' errors
Trying out an unfamiliar package, the natural thing is to use the examples given in the package's manual - hopefully, the writers of the package wouldn't include examples which didn't work! Recently, though, I've been getting 'unexpected$undefined' error messages when doing this, despite having copy/pasted the text from the manual (taking out hard breaks on the way). Moreover, I've had error messages for commands which I've previously had work fine. For instance, this from Zelig z.out < zelig(vote ~ race + educate, model = "logit", data = turnout) has at different times worked fine and thrown up the error message. Any help gratefully received. [[alternative HTML version deleted]]
David Pain
2007-Jul-28 10:03 UTC
[R] Package manual examples - 'unexpected$undefined' errors
Trying out an unfamiliar package, the natural thing is to use the examples given in the package's manual - hopefully, the writers of the package wouldn't include examples which didn't work! Recently, though, I've been getting 'unexpected$undefined' error messages when doing this, despite having copy/pasted the text from the manual (taking out hard breaks on the way). Moreover, I've had error messages for commands which I've previously had work fine. For instance, this from Zelig z.out < zelig(vote ~ race + educate, model = "logit", data = turnout) has at different times worked fine and thrown up the error message. Any help gratefully received. [[alternative HTML version deleted]]
David Pain
2007-Jul-29 20:47 UTC
[R] Fwd: Package manual examples - 'unexpected$undefined' errors
Bounced first time! ---------- Forwarded message ---------- From: David Pain <dsp0718 at googlemail.com> Date: 28-Jul-2007 11:03 Subject: Package manual examples - 'unexpected$undefined' errors To: r-help at stat.math.ethz.ch Trying out an unfamiliar package, the natural thing is to use the examples given in the package's manual - hopefully, the writers of the package wouldn't include examples which didn't work! Recently, though, I've been getting 'unexpected$undefined' error messages when doing this, despite having copy/pasted the text from the manual (taking out hard breaks on the way). Moreover, I've had error messages for commands which I've previously had work fine. For instance, this from Zelig z.out <? zelig(vote ~ race + educate, model = "logit", data = turnout) has at different times worked fine and thrown up the error message. Any help gratefully received.
Duncan Murdoch
2007-Jul-30 14:35 UTC
[R] Package manual examples - 'unexpected$undefined' errors
David Pain wrote:> Trying out an unfamiliar package, the natural thing is to use the examples > given in the package's manual - hopefully, the writers of the package > wouldn't include examples which didn't work! > > Recently, though, I've been getting 'unexpected$undefined' error messages > when doing this, despite having copy/pasted the text from the manual (taking > out hard breaks on the way). > > Moreover, I've had error messages for commands which I've previously had > work fine. > > For instance, this from Zelig > > z.out <? zelig(vote ~ race + educate, model = "logit", data = turnout) > > has at different times worked fine and thrown up the error message. > > Any help gratefully received. > > [[alternative HTML version deleted]]It's hard to say exactly what's going wrong, but a guess is that in your workspace you have an object which is somehow conflicting with an object in the package. Try starting R with the --vanilla command line option and if the errors go away, that's why. I don't know whether this applies to the Zelig package, but packages that don't define namespaces are fragile in that their internal functions can be masked by same-named functions in your workspace. Even if the package does have a namespace, you can mask functions from it that you call: for example, if you had a function called zelig (perhaps because you used fix(zelig) to make a small change to the existing one), your line above would call yours, not the original. Duncan Murdoch