# NOT RUN {
data("PhDArticles")
mod <- stages_bj(full(PhDArticles, join_unobserved = TRUE))
### simple plotting
plot(mod)
### labels in nodes
plot(mod, cex_label_nodes = 1, cex_nodes = 0)
### reduce nodes size
plot(mod, cex_nodes = 0.5)
### change line width and nodes style
plot(mod, lwd_edges = 3, pch_nodes = 5)
### changing palette
plot(mod, col = function(s) heat.colors(length(s)))
### or changing global palette
palette(hcl.colors(10, "Harmonic"))
plot(mod)
palette("default") ##
### forcing plotting of unobserved stages
plot(mod, ignore = NULL)
### use function to specify colors
plot(mod, col = function(stages){
hcl.colors(n = length(stages))
})
### manually give stages colors
### as an example we will assign colors only to the stages of two variables
### Gender (one stage named "1") and Mentor (six stages)
col <- list(Gender = c("1" = "blue"),
Mentor = c("UNOBSERVED" = "grey",
"2" = "red",
"3" = "purple",
"10" = "pink",
"18" = "green",
"22" = "brown"))
### by setting ignore = NULL we will plot also the UNOBSERVED stage for Mentor
plot(mod, col = col, ignore = NULL)
# }
Run the code above in your browser using DataLab