Skip to content

Instantly share code, notes, and snippets.

View ibartomeus's full-sized avatar

Ignasi Bartomeus ibartomeus

View GitHub Profile
@ibartomeus
ibartomeus / PollinationLandscape
Last active December 14, 2015 02:19
Plot the quantity/quality pollination landscapes for tomato bee visitors in R. Inspired in Pedro Jordano's lab work (Schupp EW, Jordano P, Gómez JM (2010) New Phytol 188:333–353) https://github.com/pedroj/effectiveness
library(plotrix)
#manually enter data
d <- data.frame(
Bee_group = c("Bombus", "Dark", "Green", "Lasioglossum"),
Efficiency = c(106.86207, 81.50000, 80.66667, 59.27586),
Eff_SE = c(15.56551, 20.12130, 17.97529, 12.25689),
Visitation = c(2.8333333, 0.2222222, 2.2222222, 5.6666667),
Visit_SE = c(0.8333333, 0.1008317, 0.7119684, 1.0966378)
)
#create a grid with value x (visitation), y (efficiency) and z = x*y.
#who are the pollinators? (a plot)
#http://ibartomeus.wordpress.com/2012/12/17/who-are-the-pollinators
#enter data manually
d <- matrix(nrow = 6, ncol = 7)
d[,1] <- c(20.000, 10, 10, 10, 200.000, 100)
d[,2] <- c(6.000, 4, 8, 9, 100.000, 20)
d[,3] <- c(14.500, 6, 4, 9, 80.000, 4)
d[,4] <- c(30.000, 7, 2, 7, 50.000, 3)
d[,5] <- c(0.328, 10, 2, 3, 1.000, 5)
@ibartomeus
ibartomeus / is.invasive.R
Created November 23, 2012 15:11
This function check which species (both plants and animals) are considered "invaders" somewhere in the world.
is.invasive()
##Description##
#This function check which species (both plants and animals) are considered "invaders" somewhere in the
# world. For that end, it checks GISD (http://www.issg.org/database/welcome/) and returns a value, either
#"Not invasive" or the brief description presented in GISD. Note that the webpage contains more
#information. Also note that the function won't tell you if it's exotic in your area, a lot of exotic
#species are not considered invaders (yet). As expected, the function is as good as the database is, which
#I find quite reliable and well maintained. The database is also able to recognize a lot (but not all) of