Food web plotting in R

The past few weeks I have been getting into R to play around with network analysis. Primarily I have been using the package igraph to generate and plot networks (random and downloaded from various datasets). So far it has been relatively easy to figure out (I am an R newbie) and it seems as if there are several very useful R packages fro network analysis. I spent a lot of time learning how to transform real data into a form that can be useful to analysis (edgelists and adjacency matrices) as well.

Here is a plot of a food web from Otago Harbor in New Zealand. The original dataset included many different interaction types including parasitism (a big step forward in food web research in my opinion) but here I took a subset of the data to plot just the predator-prey links.

The predator-prey interactions in Otago Harbor, NZ plotted using the igraph package in R.

I also used a function created by Ted Hart at Distributed Ecology to generate niche model food webs (the code for which he has posted on his github here). This function takes in number of species and connectance of the web you want and then generates a web using the niche model of Williams and Martinez 2000. So I used the properties of the Otago food web to generate a model web using the niche model function and got:

Food web generated using the niche model function created by Ted Hart based on Williams and Martinez (2000). Again plotted with igraph.

I find this sort of thing really cool. This shows how the simple niche model can clearly generate realistic food webs.

I have also started to look into methods comparing model food web structure to that of empirical ones. But more on that later I think.

This entry was posted in Research and tagged , , , , . Bookmark the permalink.

2 Responses to Food web plotting in R

  1. Pingback: More food web plotting with R | Assembling my Network

  2. aathithi says:

    i need edge betweenness community detection algorithm for rcode

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s