What is the equivalent of facet_wrap in Lattice

后端 未结 1 1625
忘掉有多难
忘掉有多难 2021-01-20 20:54

Say we have some data like this:

dta <- data.frame(
   group = rep(letters[1:8], each=1000), 
   x = runif(8000), y=runif(8000)
)

I woul

1条回答
  •  余生分开走
    2021-01-20 21:27

    library(lattice)
    xyplot(y ~ x | group, dta, layout=c(4,2), as.table = TRUE)
    

    As suggested by @BenBarnes, as.table = TRUE keeps the order of the facets.

    enter image description here

    0 讨论(0)
提交回复
热议问题