{"id":42305690,"url":"https://github.com/pedroj/bipartite_plots","last_synced_at":"2026-01-27T11:08:43.986Z","repository":{"id":9423002,"uuid":"11294302","full_name":"pedroj/bipartite_plots","owner":"pedroj","description":"`ggbipart`, an R package for plotting bipartite networks","archived":false,"fork":false,"pushed_at":"2025-04-01T18:43:06.000Z","size":53730,"stargazers_count":32,"open_issues_count":1,"forks_count":17,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-01T19:42:57.225Z","etag":null,"topics":["adjacency","bipartite-networks","ecological-network","network-visualization","networks","networks-biology","plotting-bipartite-networks"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pedroj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-07-09T21:07:57.000Z","updated_at":"2025-04-01T18:43:10.000Z","dependencies_parsed_at":"2022-09-16T14:02:25.919Z","dependency_job_id":"e7a73092-ac86-4d22-930c-9b284053fdec","html_url":"https://github.com/pedroj/bipartite_plots","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pedroj/bipartite_plots","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedroj%2Fbipartite_plots","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedroj%2Fbipartite_plots/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedroj%2Fbipartite_plots/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedroj%2Fbipartite_plots/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pedroj","download_url":"https://codeload.github.com/pedroj/bipartite_plots/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedroj%2Fbipartite_plots/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28812371,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T07:41:26.337Z","status":"ssl_error","status_checked_at":"2026-01-27T07:41:08.776Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adjacency","bipartite-networks","ecological-network","network-visualization","networks","networks-biology","plotting-bipartite-networks"],"created_at":"2026-01-27T11:08:42.749Z","updated_at":"2026-01-27T11:08:43.981Z","avatar_url":"https://github.com/pedroj.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"`ggbipart`: An `R` package for plotting bipartite networks\n========================================================\n\nThe `ggbipart` package includes a series of `R` functions aimed to plot bipartite networks. Bipartite networks are a special type of network where nodes are of two distinct types or sets, so that connections (links) only exist among nodes of the different sets.\n\nAs in other types of network, bipartite structures can be binary (only the presence/absence of the links is mapped) or quantitative (weighted), where the links can have variable importance or weight.\n\nTo plot, we start with an adjacency or incidence matrix. I'm using matrices that illustrate ecological interactions among species, such as the mutualistic interactions of animal pollinators and plant flowers. The two sets (modes) of these bipartite networks are animals (pollinators) and plants species.\n\nFrom any adjacency matrix we can get a `network` object or an `igraph` object for plotting and analysis. The main function in the package is `bip_ggnet`.\n\n### Installation\n\n```r\ndevtools::install_github(\"pedroj/bipartite_plots\")\nlibrary(ggbipart)\n\n```\n\n### An unweighted, binary network\n\nThis graph uses function `bip_railway`.\n\n```r\n# Plot layout coordinates for railway networkplot. Input is the\n# adjacency matrix.\n#\nmymat \u003c- read.delim(\"./data/data.txt\", row.names=1)   # Not run.\ng\u003c- bip_railway(mymat, label=T)\ng+ coord_flip()\n\n```\n![bip_ggnet1](http://pedroj.github.io/bipartite_plots/images/Rplot00.png)\n\n### A weighted network with edges labelled\n\nThis graph uses function `bip_ggnet`, with labelled edges.\n\n```r\n#-----------------------------------------------------------\n# Simple graph prototype for a weighted network.\n\nbip= data.frame(P1= c(1, 12, 6, 0),\n                P2= c(1, 0, 4, 0),\n                P3= c(1, 7, 3, 12),\n     row.names= letters[1:4])\ncol= c(\"A\"= \"grey80\", \"P\"= \"gold2\")\nbip.net\u003c- bip_init_network(as.matrix(bip))\n\nbip_ggnet(bip.net, as.matrix(bip),\n       #  color= \"mode\", palette = col,\n          edge.label = \"weights\",\n          label= TRUE)\n#-----------------------------------------------------------\n#\n```\n![bip_ggnet1](http://pedroj.github.io/bipartite_plots/images/Rplot1.png)\n\n\n### A weighted network with nodes numbered\n\nThis graph uses function `bip_ggnet`, with labelling nodes modified with additional `geoms`.\n\n```r\n#-----------------------------------------------------------\n# Numbered nodes\n# The Nava de las Correhuelas dataset.\nnch\u003c- read.table(\"./data/sdw01_adj_fru.csv\", \n                 header=T, sep=\",\", row.names=1,\n                 dec=\".\", na.strings=\"NA\")\n\nnch.net\u003c- bip_init_network(as.matrix(nch))\n\nnums\u003c- as.vector(c(1:sum(dim(nch))))\npp3\u003c- bip_ggnet(nch.net, as.matrix(nch),\n          size= 0,\n          shape= \"mode\",\n          palette= \"Set1\",\n          color= \"mode\",\n          layout.exp = 0.25) +\n          geom_point(aes(color= color), size= 10,\n                         color= \"white\") +\n          geom_point(aes(color= color), size= 10,\n                         alpha= 0.5) +\n          geom_point(aes(color= color), size= 8) +\n          geom_text(aes(label= nums),\n                        color= \"white\", size= 3.5,\n                        fontface=\"bold\") +\n          guides(color= FALSE) +\n          theme(legend.position=\"none\")        # Hide legend\npp3\n#-----------------------------------------------------------\n#\n```\n![bip_ggnet1](http://pedroj.github.io/bipartite_plots/images/Rplot2.png)\n\n\nA detailed descripton of all the above code is in my [git pages](http://pedroj.github.io/bipartite_plots/).\n\n[\u003cimg src=\"https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png\"\u003e](https://creativecommons.org/licenses/by-nc/4.0/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedroj%2Fbipartite_plots","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpedroj%2Fbipartite_plots","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedroj%2Fbipartite_plots/lists"}