PPS 3-State Model

December 16, 2013
By

[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.

I recently found THIS site on the internet which I thought would be another good case-study.

As a standalone figure, it can be rendered as follows with ggtern:

#Load the data
df <- read.table(file = "~/Desktop/PPS-data.txt", header = T)

#Create the plot and store
plot <- ggtern(data = df, aes(x = Xyp, y = XO, z = XY)) + 
               geom_point(aes(fill = Root),
                          size = 4, 
                          shape = 21, 
                          color = "black") + 
               ggtitle("PPS 3-State Model") + 
               labs(fill = "Root States") + 
               theme_tern_rgbw() + 
               theme(legend.position      = c(0,1), 
                     legend.justification = c(0, 1))

#Render
plot

plot of chunk unnamed-chunk-2

However, in order to distinguish the different categories, perhaps a facetted approach would be better:

#Render w/ Facetting
plot + facet_wrap(~Root)

plot of chunk unnamed-chunk-3

The post PPS 3-State Model 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.



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers

Sponsors

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)