From deepayan@stat.wisc.edu  Tue Mar  4 01:44:13 2003
From: deepayan@stat.wisc.edu (deepayan@stat.wisc.edu)
Date: Tue Mar  4 01:44:13 2003
Subject: [Rd] question on latticeParseFormula (PR#2602)
Message-ID: <200303040044.h240iB35024211@pubhealth.ku.dk>

The fact that an attempt at adding an unordered and an ordered factor gives an 
error 

1. is not a bug (at least I can't imagine why it would be so)
2. has nothing to do with latticeParseFormula

Also, I very much doubt that getting a bunch of NA's and a warning (which you 
seem to have omitted from your output) is really what you anticipated when 
you added two (unordered) factors.

Please first report what you think are bugs on r-devel before filing bug 
reports.


On Monday 03 March 2003 06:04 pm, rmh@surfer.sbm.temple.edu wrote:
> This feels like inconsistent behavior.  latticeParseFormula works the
> way I anticipated for factor, but not for ordered.  I want the
> behavior I see with tmp2, but not with tmp.  My next step is to use
> the right.name to isolate the tmp2[,c("a","b")] columns.
>
>
> tmp <- data.frame(y=(1:12)+.1,
>                   a=factor(rep(1:3,4)),
>                   b=ordered(rep(1:4, c(3,3,3,3))))
> latticeParseFormula(as.formula(y ~ a + b), data=tmp)
>
> tmp2 <- data.frame(y=(1:12)+.1,
>                   a=factor(rep(1:3,4)),
>                   b=factor(rep(1:4, c(3,3,3,3))))
> latticeParseFormula(as.formula(y ~ a + b), data=tmp2)
>
> > version
>
>          _
> platform i386-pc-mingw32
> arch     i386
> os       mingw32
> system   i386, mingw32
> status
> major    1
> minor    6.2
> year     2003
> month    01
> day      10
> language R
>
> > tmp <- data.frame(y=(1:12)+.1,
>
> +                   a=factor(rep(1:3,4)),
> +                   b=ordered(rep(1:4, c(3,3,3,3))))
>
> > latticeParseFormula(as.formula(y ~ a + b), data=tmp)
>
> Error in a + b : non-numeric argument to binary operator
>
> > tmp2 <- data.frame(y=(1:12)+.1,
>
> +                   a=factor(rep(1:3,4)),
> +                   b=factor(rep(1:4, c(3,3,3,3))))
>
> > latticeParseFormula(as.formula(y ~ a + b), data=tmp2)
>
> $left
>  [1]  1.1  2.1  3.1  4.1  5.1  6.1  7.1  8.1  9.1 10.1 11.1 12.1
>
> $right
>  [1] NA NA NA NA NA NA NA NA NA NA NA NA
>
> $condition
> NULL
>
> $left.name
> [1] "y"
>
> $right.name
> [1] "a + b"
>
>
>
> Rich
>
> ______________________________________________
> R-devel@stat.math.ethz.ch mailing list
> http://www.stat.math.ethz.ch/mailman/listinfo/r-devel



[Rd] question on latticeParseFormula (PR#2602)
deepayan@stat.wisc.edu