Created
February 10, 2025 19:57
-
-
Save vincentarelbundock/90ea29655900f381d9eb9bf1fb239cad to your computer and use it in GitHub Desktop.
plt_add
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lambda1 <- 1.8 | |
lambda2 <- 0.7 | |
x <- 0:10 | |
p1 <- dpois(x,lambda1) | |
p2 <- dpois(x,lambda2) | |
dp <- data.frame(x=c(x,x),p=c(p1,p2),lambda=rep(c(lambda1,lambda2),each=length(x))) | |
dp$lambda <- as.factor(dp$lambda) | |
plt(p ~ x, | |
facet = ~lambda, | |
data = dp, | |
type = "h", | |
lwd = 2, | |
col = "skyblue") | |
plt_add(type = "p") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment