Version 2.1.1 Released

[This article was first published on ggtern: ternary diagrams in R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Hi Folks, ggtern v2.1.1 has just been submitted to CRAN. This includes a number of minor bug fixes, and an additional annotation, permitting the rendering of raster data, say for the inclusion of images. This post will demonstrate the use of this requested feature.

Demonstration of Raster Annotation

Several people have asked me how they can overlay their new data over the top of an existing ternary diagram, say from a publication and the like. Included in this ggtern 2.1.1 is raster-array data for Figure 6 from Elkins and Groves Feldspar[1], lets dive in and demonstrate how to overlay some fresh points over this existing figure, for the sake of convenience, lets use the data from the same paper for the points themselves.:

#Load necessary libraries
library(ggtern)

#Load the Datasets
data(Feldspar)
data(FeldsparRaster)

#Build the Plot
ggtern(Feldspar,aes(Ab,An,Or)) + 
  theme_rgbw() + theme_nogrid() + theme_legend_position() + 
  annotation_raster_tern(FeldsparRaster,xmin=0,xmax=1,ymin=0,ymax=1) +
  geom_mask() + 
  geom_point(size=5,aes(shape=Feldspar,fill=Feldspar),color='black') +
  scale_shape_manual(values=c(21,24)) +
  labs(title="Demonstration of Raster Annotation")

This produces the following result:

annotation_raster_tern

If people have suggestions for further additions, I welcome this input, and as usual, if this package has assisted you in your work, please feel free to contribute to my beer fund via the donations link at the top of the page.

References

[1] L. T. Elkins and T. L. Grove, “Ternary Feldspar Experiments and Thermodynamic Models,” American Mineralogist, vol. 75, iss. 5-6, pp. 544-559, 1990.
[Bibtex]
@Article{elkins1990ternary,
Title = {Ternary Feldspar Experiments and Thermodynamic Models},
Author = {Elkins, Linda T and Grove, Timothy L},
Journal = {American Mineralogist},
Year = {1990},
Number = {5-6},
Pages = {544--559},
Volume = {75},
File = {elkins1990ternary.pdf:Users/nick/Copy/UNSW/PhD/References/Referenced/elkins1990ternary.pdf:PDF},
Owner = {Nick Hamilton},
Publisher = {Mineral Soc America},
Timestamp = {20140123}
}

The post Version 2.1.1 Released appeared first on ggtern: ternary diagrams in R.

To leave a comment for the author, please follow the link and comment on their blog: ggtern: ternary diagrams in R.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)