Giter VIP home page Giter VIP logo

bipartite_webs's Introduction

Edits to functions visweb and plotweb from the R package bipartite

Note the naming equivalence:

  • plot_grid corresponds to bipartite::visweb (Aug 19, 2015)
  • plot_bipartite corresponds to bipartite::plotweb (Oct 6, 2014)

Original code for functions visweb (plot_grid) and plotweb (plot_bipartite) was taken from bipartite GitHub repository. I made a fork initially, but I realized soon than the repository is taking more space that I am willing to allocate.

All in all, I am only interested in editing the two functions mentioned above for personal use, so I started this separate repository.

Usage

This is work in progress!

library(bipartite)
# Source the functions from this repository
source("https://raw.githubusercontent.com/valentinitnelav/bipartite_webs/master/R/plot_bipartite.R")
source("https://raw.githubusercontent.com/valentinitnelav/bipartite_webs/master/R/plot_grid.R")

Edits / Additional features:

in plot_bipartite (bipartite::plotweb)

  • disable par modifications during function call;
  • label adjustments:
  • allow label size separately for lower and upper trophic levels;
  • allow text rotation separately for lower and upper labels;
  • allow adjustment of pos, offset and font separately for lower and upper labels;

in plot_grid (bipartite::visweb)

  • disable par modifications during function call;
  • add x.lim & y.lim arguments used for the same purpose as in plotweb;
  • label adjustments:
    • allow side, las, font and mgp changes for axis labels;
    • add mtext for axis titles;
    • better replace mtext with text, which allows text rotation with srt; see this FAQ or this blog post;
    • use also text for axis labels instead of the current axis (for the same reason as above);
    • re-arrange code (plot first matrix, then annotation) - this helps detecting if labels are under the matrix when testing edits;
    • allow different sorting of the matrix to get the nestedness visual effect in any desired corner. This can be helpful when needing to rotate/further edit graphs in Inkscape.
    • implement label/species coloring

License

The package bipartite is licensed under GPL (mentioned here) and this trickles down to this repository.

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.