2013-10-22 34 views
10

Oluşturulduktan sonra mevcut bir kafes paneline nasıl nokta veya veri dizisi ekleyeceğinizi anlamaya çalışmak. Bunun plot.points ve/veya güncelleme fonksiyonu ile bir ilgisi var mı?Bir kafes panelinde xyplots'un birleştirilmesi veya üst üste getirilmesi

# Initialize first plot 
library(lattice) 
a <- xyplot(Sepal.Length~Sepal.Width, groups=Species, data=iris 
      , subset=Species %in% levels(Species)[1:2]) 
print(a) 

# Create second plot to overlay or merge with the first plot 
b <- xyplot(Sepal.Length~Sepal.Width, groups=Species, data=iris 
      , subset=Species %in% levels(Species)[3]) 

# Initial attempt at merging plots: 
library(latticeExtra) 
print(c(a,b)) # this displays the data in an adjacent second panel 
print(c(a,b,layout=c(1,1))) # and this only shows series "b" 

Not: Bu örnekte, her iki araziler "a" ve "b", orijinal iris dataframe, ama ideal çözüm farklı dataframes ile çalışacak geliyor.

Herhangi bir fikrin var mı? Teşekkürler!
Bryan

cevap