[R] Why does a custom function called is.numeric.factor break lattice?

sbihorel
Mon, 16 Nov 2015 02:22:42 -0000

Hi,

Pretty much everything is in the title of the post. An example is below.

library(lattice)
data <-
data.frame(x=rep(1:10,8),y=rnorm(80),trt=factor(rep(1:4,each=20)),groups=rep(1:8,each=10))
xyplot <- xyplot(y~x|trt,data,groups=groups)

is.numeric.factor <- function(){
   print('hello world')
}

xyplot <- xyplot(y~x|trt,data,groups=groups)

Thanks for shedding some light on this.