catch.t <- xtabs(Catch~Year+Age, catch.d) # example table
catch.m <- as.matrix(as.data.frame(unclass(catch.t))) # example matrix
# 1 Formula
bubbleplot(Catch~Age+Year, data=catch.d)
# Use rev=TRUE to get same layout as crosstab matrix:
print(catch.m)
bubbleplot(Catch~Age+Year, data=catch.d, rev=TRUE, las=1)
# 2 Data frame
bubbleplot(catch.d)
bubbleplot(Orange)
# Visualize tree transverse section at breast height
bubbleplot(Orange, pow=1, cex=2, pch=21,
col="darkred", bg="peru", lwd=1.5)
# 3 Matrix or table
bubbleplot(catch.m)
bubbleplot(catch.t)
# 4 Positive and negative values
bubbleplot(catch.r)
bubbleplot(Resid~Age+Year, catch.r, subset=Age %in% 4:9,
rev=TRUE, xlim=c(3.5,9.5), cex=1.3)
# Residuals from orange tree model
library(nlme)
fm <- nlme(circumference~phi1/(1+exp(-(age-phi2)/phi3)),
fixed=phi1+phi2+phi3~1, random=phi1~1|Tree,
data=Orange, start=c(phi1=200,phi2=800,phi3=400))
bubbleplot(residuals(fm)~Tree+age, Orange)
bubbleplot(residuals(fm)~Tree+age, Orange, cex=2.5, pch=16,
col=c("dodgerblue","orange"))
# 5 Richter magnitude, amplitude, and energy release
bubbleplot(mag~long+lat, quakes, pch=1)
bubbleplot(10^mag~long+lat, quakes, cex=1.2, col=gray(0, 0.3))
bubbleplot(sqrt(1000)^mag~long+lat, quakes, cex=1.2, col=gray(0, 0.3))
bubbleplot(sqrt(1000)^mag~long+lat, quakes, cex=1.2, col="#FF00004D")
Run the code above in your browser using DataLab