[R] 3d barplot in rgl
Chris Stubben
stubben at lanl.gov
Wed Sep 26 18:28:56 CEST 2007
> Transition matrices are Markov transition matrices among different
> life stages of organisms -- in the simplest case (Leslie matrices,
Ben,
Thanks for your clear explanation and plot examples. I like the dotplots alot
and added a few modifications below. Since I often compare rows and columns as
well as groups of elements representing growth (lower left trianlge), stasis
(diagonal), fertility etc., I like to preserve the matrix structure in the plot
if possible.
>
> library(popbio)
> example(teasel) ## shows 2 plots -- heatmap and stair-step
> A <- tea$sensitivities ##
> z <- as.data.frame.table(A)
#switch labels here- stage at time t in columns and fate at time t+1 in rows
names(z) <- c("To","From","Sensitivity")
# reverse order on rows to match matrix
z$To <- ordered(z$To, levels = rev(levels(z$To)))
dotplot(To~Sensitivity|From, data=z,
scales=list(alternating=c(1,0), tck=c(1,0)), layout=c(6,1), aspect=2)
# or log-scale
dotplot(To~Sensitivity|From,data=z,scales=list(x=list(log=TRUE)), as.table=TRUE)
Thanks again,
Chris
More information about the R-help
mailing list