Recently ggplot2 received a severe makeover by releasing version 2.0, and in the spirit of improvement, I thought ggtern should also get an overhaul, so after a few-hundred hours of code review, here is what has changed:
Theme elements:
Previously, the nomenclature scheme for the new theme elements was a bit all over the shop, so the theme elements have been renamed. Every custom theme element for this package begins with ‘tern.XXX’ such as ‘tern.panel.background’ or ‘tern.axis.clockwise’, for the full list of new theme elements, see the help file:
?theme_elements
Approved Geometries:
ggplot2 v2.0 has many new geometries, and not all of them are relevant to ggtern, so like before, this package has an opt-in policy where only certain geometries are approved:
geom_point, geom_path, geom_line, geom_label geom_text, geom_jitter, geom_polygon, geom_segment, geom_count and geom_blank.
New Geometries:
ggtern 2.0 carries over the existing geometries, and also ads a few more, the full list is as follows:
geom_Tline, geom_Rline, geom_Lline, geom_errorbarT, geom_errorbarL, geom_errorbarR, geom_density_tern, geom_confidence_tern, geom_mask, geom_smooth_tern, geom_Tisoprop, geom_Lisoprop, geom_Risoprop and geom_interpolate_tern
Stats and Positions:
The full list of approved stats are as follows:
stat_identity, stat_confidence, stat_density_tern, stat_smooth_tern, stat_sum, stat_unique, and stat_interpolate_tern
whilst the approved positions are as follows:
position_identity, position_nudge_tern and position_jitter_tern
Rebuilt Plot Arrangement Routine
The ggptern plot assembly routine has been completely re-written, the layout is much more predictable, one of the main achievements was providing the ability to rotate and shift the diagrams quite easily, here is an example:
data(Feldspar) arrangement = list() for(r in seq(0,60,by=20)){ x = ggtern(data=df,aes(Ab,An,Or)) + geom_point() + theme_showarrows() + theme_rotate(r) + ggtitle(sprintf("%i Degrees",r)) arrangement[[length(arrangement) + 1]] = x } grid.arrange(grobs = arrangement)
Use of Orthonormal Basis
Several of the routines use isometric-logratio basis transformations, here is an example, using a new data-set included in the package, here we …read more
Source:: r-bloggers.com