View source: R/plotAssignments.R
plotAssignments | R Documentation |
Plot individual assignment probability distributions.
plotAssignments(
probs,
orig,
type = NULL,
ylab = NULL,
freq.sep.line = TRUE,
plot = TRUE
)
probs |
matrix or data.frame of individual assignment probabilities. Each column represents probability of assignment to that group and rows sum to one. |
orig |
vector of original group assignments |
type |
either |
ylab |
label for y-axis |
freq.sep.line |
put frequency of original group on second line in facet
label? If |
plot |
display the plot? |
the ggplot
object is invisibly returned.
Eric Archer eric.archer@noaa.gov
n <- 40
probs <- abs(c(rnorm(n, 80, 10), rnorm(n, 20, 10)))
probs <- (probs - min(probs)) / max(probs)
probs <- cbind(probs, 1 - probs)
colnames(probs) <- NULL
orig <- rep(c("Group.1", "Group.2"), each = n)
plotAssignments(probs, orig)
n <- 15
probs <- abs(c(rnorm(n, 80, 10), rnorm(n, 20, 10)))
probs <- (probs - min(probs)) / max(probs)
probs <- cbind(probs, 1 - probs)
colnames(probs) <- NULL
orig <- rep(c("Group.1", "Group.2"), each = n)
plotAssignments(probs, orig)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.