[R] Baffled: triggering error message with an sd result in odfWeave?

Sarah Goslee sarah.goslee at gmail.com
Mon Dec 15 17:24:46 CET 2008

I'd take a good look at trainlength, trainscores and traindev using str()
and summary(), and print at least part of each to the screen. If the same
line of code works with one dataset and not another, the problem is more
likely your data than your code.

If that doesn't help you figure it out, posting the str() and summary()
results here can help the R-helpers diagnose the problem.


On Mon, Dec 15, 2008 at 11:12 AM, Tubin <sredmonson at yahoo.com> wrote:
> I hope someone can point out my stupid error, because I'm baffled.
> I am calculating a bunch of variable values and then placing them in a
> document using odfWeave tags.
> This is working very nicely for every spot except one.
> One of the values I calculate is traindev:
>  traindev <- if (trainlength>0) round(sd(trainscores, na.rm=T),1) else ""
> when I try to insert this traindev value anywhere in my odfWeave document
> (using \Sexpr{traindev} ), I get the following error:
> Start tag expected, '<' not found
> Error: 1: Start tag expected, '<' not found
> Another formula,
> postsd<- if (postlength>0)  round(sd(postscores, na.rm=T),1)  else ""
> does not trigger the same error.
> It's not something strange with the variable name; give any other value to
> that variable and odfWeave works just fine.  It's not the spot on the
> document; any other tag works great in that spot and but traindev triggers
> the error wherever I try to put it.
> I've spent a horrendously long time trying to figure it out. Can anyone help
> me out?
Sarah Goslee

More information about the R-help mailing list