Learn R Programming

trifield (version 1.1)

trifield-package: Assists in creating and plotting ternary fields

Description

The package can project between unity-summed ternary vectors and binary vectors. An "apply" function is provided to apply a function over a ternary field, as is a function for constructing ternary grids. Some rudimentary plotting functions are also provided. This is quick and dirty research code I needed in the course of writing a manuscript. Take it as such.

Arguments

Details

Package:
trifield
Type:
Package
Version:
1.0
Date:
2011-07-24
License:
GPL 2
LazyLoad:
yes
Some simple routines, mainly aimed at making ternary fields and contour plots.

References

http://dx.doi.org/10.1016/j.ecolmodel.2012.05.020

Examples

Run this code
# See demo(trifield)
## Not run: 
# grid.size = 128
# par(mar = rep(2, 4), oma = rep(0, 4))
# tg = ternary.grid(grid.size)
# f = function(x)
#         sin(2 * pi * x[1]) +
#         sin(3 * pi * x[2]) +
#         sin(4 * pi * x[3])
# z = ternary.apply(tg, f)
# tf = ternary.field(tg, z)
# plot(tf)
# ternary.legend()
# ## End(Not run)

Run the code above in your browser using DataLab