[R] Sweave question

Seth Falcon sfalcon at fhcrc.org
Tue Dec 23 17:43:34 CET 2003


I'm not certain, but since you are getting a parse error, I would try
curly brackets on your if statement:

    <<fig=TRUE,echo=F>>=
    par(mfrow=c(1,1))
    if(exists("x")) {
            plot(x,x)
    } else {
    plot(1,1,type="n")
    text(1,1,"data not available.\n")
    }
    @

HTH,

+ seth




More information about the R-help mailing list