Learn R Programming

rysgran (version 2.1.0)

rysgran.ternary: Generates the Ternary Diagrams of Shepard, Pejrup and Flemming

Description

Uses data from percentages of soil textures to generate ternary diagrams of Shepard (Shepard, 1954), Pejrup (Pejrup, 1988) and Flemming (Flemming, 2000)

Usage

rysgran.ternary(x = NULL, method = "shepard", lang = "en-US", main= NULL, z= NULL, show.labels=FALSE, label.points=FALSE, labels = NULL, axis.labels = NULL, show.names = TRUE, show.lines = TRUE, show.legend = TRUE, show.grid = FALSE, z.cex.range= NULL, cex.labels= 1, cex.points=1, cex.axis=1, cex.names = 0.8, col.names = "gray2", col = "black", col.labels= "black", col.axis= "black", col.lines= "black", col.grid = "gray", pos = 1, pch = 19, lty.grid = 3, ...)

Arguments

x
a 3 columns matrix with percentages of Sand, Silt and Clay (exactly in this order) which should be passed by class.percent function. The sum of each row must be 100 or 1, otherwise there may be distortions in the position of the points
method
shape of ternary diagram to be created. Should be "shepard", "pejrup" or "flemming". Default is "shepard"
lang
language . Should be English ("en-US", "en-GR", "eng", "e"), or Portuguese ("pt-BR", "pt-PT", "port", "p"). The default is "en-US"
main
an overall title for the plot. If NULL it will be generated an automatic title according to language chosen. Default is NULL
z
vector with the same length of x and y whose value must be used to define the points expansion factor and color (bubble plot). If NULL, a simple plot is drawn (no 'bubbles'). Default is "NULL"
show.labels
logical. If TRUE the points are replaced by text passed by labels argument. Default is FALSE
label.points
logical. if TRUE text is added, provided by the argument labels, with the points on the graph. the text position to the point should be changed by argument pos. labels.points will be automatically FALSE if show.labels is TRUE. The default is FALSE
labels
a character vector or expression specifying the text to be written. If NULL labels will be the row names of the data argument. Default is NULL
axis.labels
vector of length 3 with the soil textures names. If NULL the names are taken from the matrix of percentages. Default is NULL
show.names
logical. If TRUE the textural classes names will show up in the ternary diagram according with the method argument. Should be used with the argument show.legend. Default is TRUE
show.lines
logical. If TRUE the lines that separate the textural classes are displayed. Default is TRUE
show.legend
logical. If TRUE the legend of textural classes are displayed in the top left according with the argument method. Should be used with the argument show.names. Default is TRUE
show.grid
logical. If TRUE display grid lines in the ternary diagram. Default is FALSE
z.cex.range
Vector of length 2. Minimum and maximum 'cex' of the bubbles plotted if 'z' is not NULL. Replace the argument cex.points. Default is "(1,3)"
cex.labels
character size of text provided by the argument labels added with the point (or replacing it) in case show.label, label.points or z arguments are defined. Default is "1"
cex.points
character size of points provided by the argument pch. Default is "1"
cex.axis
character expansion for axis labels. Default is "1"
cex.names
character size of text of textural classes text which composes the ternary diagram according to method argument. Default is "1"
col.names
text color of textural classes which composes the ternary diagram if the argument show.names is TRUE. Default is "gray"
col
symbol color used in pch argument if the argument show.labels is FALSE. Default is "black"
col.labels
text color of labels if the arguments show.label, label.points or z are defined. Default is "black"
col.axis
text color of axis labels. Default is "black"
col.lines
color of lines that separate the textural classes case the argument show.lines is TRUE. Default is "black"
col.grid
color of grid lines case the argument show.grid is TRUE. Default is "gray"
pos
a position specifier for the text. Values of 1, 2, 3 and 4, respectively, indicate positions below, to the left of, above and to the right of the specified coordinates. Default is "1"
pch
either an integer specifying a symbol or a single character to be used as the default in plotting points. Default is "19"
lty.grid
type of grid line case the argument show.grid is TRUE. Default is "3"
...
further graphical parameters

Value

Details

When z argument is used to draw bubble plots the legend.bubbles function should be used to draw the legend accordingly

References

- Flemming, B. W. (2000) A revised textural classification of gravel-free muddy sediments on the basis of ternary diagrams. Continental Shelf Research, 20:1125--1137.

- Pejrup, M. (1988) The triangular diagram used for classification of estuarine sediments: a new approach. in: Tide-influenced sedimentary environments and facies. BOER, P.L. ; GELDER, A. & NIO, S.D. (Eds). D. Reidel Publishing Company. Holland.

- Shepard, F. P. (1954) Nomenclature based on sand-silt-clay ratios. Journal Sedimentary Petrology, 24:151--158.

See Also

gran.stats , class.percent , rysgran.ternary , rysgran.hist, legend.bubbles

Examples

Run this code

library(rysgran)
data(camargo2001)
data(sed.phi)

#Shepard diagram
percent <- class.percent(camargo2001, mode="total")
x<-percent[2:4] #choosing only the 'sand', 'silt' and 'clay' columns
rysgran.ternary  (x, method = "shepard")


#Pejrup diagram
percent <- class.percent(camargo2001, mode="total")
x<-percent[2:4] #choosing only the 'sand', 'silt' and 'clay' columns
rysgran.ternary  (x, method = "pejrup")

#Flemming diagram
percent <- class.percent(camargo2001, mode="total")
x<-percent[2:4] #choosing only the 'sand', 'silt' and 'clay' columns
rysgran.ternary  (x, method = "flemming")

#Shepard diagram with show.labels
percent <- class.percent(camargo2001, mode="total")
x<-percent[2:4]
rysgran.ternary (x, method="shepard", show.labels = TRUE)


#Pejrup diagram with Sorting as bubbles for different environments
#Calculating the percentage of weight in each textural class
percent <- class.percent(sed.phi, mode="total")
x<-percent[2:4]

# Calculating the grain size statistics
rys <- gran.stats(sed.phi , method="folk")
env<- as.factor(rep(c("River","Tidal Flat","Subtidal","Beach"),each=10))

# Plotting
rysgran.ternary (x, method = "pejrup",
	z = rys$Sorting, z.cex.range = c(0.5,3), 
	col = c("red","blue","black","brown")[env], pch = 19)

# Plotting the legends
legend.bubbles ("right", z=rys$Sorting , nleg=4, pch=21, col="black",
	cex=1, z.cex.range=c(0.5,3), x.intersp=1.2, y.intersp=1.2,
	digits=1, title="Sorting")

legend ("topright", c("Beach","River","Subtidal","Tidal Flat"),
	pch=15, col=c("red","blue","black","brown"))

Run the code above in your browser using DataLab