[R] Parse error in xtabs

Andrew Perrin andrew_perrin at unc.edu
Wed Apr 4 15:27:25 CEST 2001


Okay, here's the output done the right way :). I notice that the ~
grouptype shows up in both elements of the text vector - perhaps that's
a problem.

Andy Perrin

> debug(parse)
> l.agg<-xtabs(cbind(r.logic.interests, r.logic.morality,
+ r.logic.enlightened, r.logic.capacity,r.logic.mediate) ~ grouptype,
+ data=gt)
debugging in: parse(text = x)
debug: {
    if (is.character(file)) 
        if (file == "") 
            file <- stdin()
        else {
            file <- file(file, "r")
            on.exit(close(file))
        }
    .Internal(parse(file, n, text, prompt))
}
Browse[1]> text
[1] "cbind(r.logic.interests, r.logic.morality, r.logic.enlightened,  ~
grouptype"
[2] "    r.logic.capacity, r.logic.mediate) ~
grouptype"                          
Browse[1]> n
debug: if (is.character(file)) if (file == "") file <- stdin() else {
    file <- file(file, "r")
    on.exit(close(file))
}
Browse[1]> n
debug: .Internal(parse(file, n, text, prompt))
Browse[1]> n
Error in parse(file, n, text, prompt) : parse error


Peter Dalgaard BSA wrote:
> 
> Andrew Perrin <aperrin at socrates.berkeley.edu> writes:
> 
> > Well, for whatever reason debug() isn't stepping through for me:
> >
> >
> > > debug(xtabs(cbind(r.logic.interests,
> > r.logic.morality,r.logic.enlightened, r.logic.capacity,r.logic.mediate)~
> > grouptype,data=gt))
> > Error in parse(file, n, text, prompt) : parse error
> 
> That's not the way to do it:
> 
> debug(parse)
> 
> xtabs(cbind(r.logic.interests,
>  r.logic.morality,r.logic.enlightened, r.logic.capacity,r.logic.mediate)~
>  grouptype,data=gt)
> 
> --
>    O__  ---- Peter Dalgaard             Blegdamsvej 3
>   c/ /'_ --- Dept. of Biostatistics     2200 Cph. N
>  (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
> ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907

-- 
--------------------------------------------------------------
Andrew J. Perrin - Programmer/Analyst, Desktop Support
Children's Primary Care Research Group, UNC - Chapel Hill
(919)966-9394 * andrew_perrin at unc.edu
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list