0
Ich möchte mehrere Datensätze in diesem Diagramm plotten, aber ich kann nicht herausfinden, wie. Ich muss t
, u
, v
, w
auf die bereits funktionierende xyplot
setzen.Plotten mehr als einen Datensatz in R mit xyplot
library(lattice)
x <- rnorm(250, 5, .5)
y <- rnorm(250, 5, .4)
t <- rnorm(200, 6, .7)
u <- rnorm(200, 6, .6)
v <- rnorm(150, 7, .9)
w <- rnorm(150, 7, .8)
xyplot(y ~ x, xlab="", ylab="",
par.settings = list(axis.line = list(col="transparent")),
panel = function(x, y,t,u,...) {
panel.xyplot(x, y, col=3, pch=16)
panel.rug(x, y, col=8, x.units = rep("snpc", 2), y.units = rep("snpc",
2), ...)})
[ggplot2] (http://ggplot2.tidyverse.org/reference/aes_group_order.html) ist ein einfacher Weg. – Enigma