Giter VIP home page Giter VIP logo

simplexgraphs's Introduction

SimplexGraphs

R code to draw simplex graphs


A few functions to draw simplex graphs and add data points.

The main functions are:

  • simplexPlot

    arguments include:

    • plotData (default = 0): This should be a matrix or data.frame in which the first three columns represent the values for the upper vertex, the lower left vertex, and the lower right vertex, respectively.
    • vertexlabels: a vector of three elements to label the three vertices (upper, lower left, lower right)
    • drawLabels (default = FALSE): whether to draw the vertex labels or not
    • cexLabels (default = .5): size to draw the vertex labels
    • cexPoints (default = .1): size to draw the points
    • main (default = ""): title of graph
    • col (default = black): The color to paint the points

    Example:
    myData = matrix(c(0.9,0.1,0,.05,.9,.05), ncol=3, byrow=T)
    simplexPlot(myData, cexPoints = .5, col="red", vertexLabels = c("A","B","C"), drawLabels = TRUE)

  • quartetPlot

    An extension of simplexPlot designed to display concordance factors or posterior probabilities for the three topologies in phylogenetic studies of quartets. The display replaces the vertex labels with small tree diagrams. Arguments include:

    • plotData: same as above, the column order of the data should be (12|34), (13|24), (14|23).
    • binLabels (default NULL): A vector with labels for the four taxa. If provided, a legend is drawn to the upper left of the simplex.
    • cexLabels (default = .7): the size of the legend text
    • cexPoints (default = .1): same as above
    • main (default = ""): same as above
    • col (default = black): same as above

    Example:
    myData = matrix(c(0.9,0.1,0,.05,.9,.05), ncol=3, byrow=T)
    quartetPlot(myData, cexPoints = .5, col="red", binLabels = c("outgroup","gorillas","humans","chimps"))

  • simplexPoints

    This function adds points to an already drawn simplex plot. Arguments include:

    • plotData: same as above.
    • col: same as above.
    • cexPoints: same as above.

    Example:
    myData = matrix(c(0.9,0.1,0,.05,.9,.05), ncol=3, byrow=T)
    quartetPlot(0, binLabels = c("outgroup","gorillas","humans","chimps"))
    simplexPoints(myData[1,,drop=F], col="red", cexPoints = 1)
    simplexPoints(myData[2,,drop=F], col="blue", cexPoints = 1)

simplexgraphs's People

Contributors

botanyhunter avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.