is.invasive( )

Celebrating that I am contributing to the R-bloggers.com blog aggregator I am going to post a very simple function to check which species (both plants and animals) are considered “invaders” somewhere in the world. Basically the function asks that to the Global Invasive Species Database (GISD).

I coded this because a friend of mine aks me precisely that question [Yes, friends assumes you should know this kind of stuff (and also why the plants of their balcony are dying) off the top of your head just because you are a biologist]. However, I do not know much things and I am too lazy to check all 250 species one by one on the GISD webpage. Also is a good R practice, and I am ok investing some work time on personal projects. Google (and other big companies) encourage it’s employees to spend 20% of the time working on projects that aren’t necessarily in their job descriptions in order to bust its innovation power, so that should be even more important in science!

Hope it can be useful to more people, I uploaded the code as a Gist:

UPDATE: The function is now available on taxize R package developed by the rOpenScience people!


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
#the species synonyms. This function worked for me, but I didn't test it intensively, and any changes on
#the webpage html design will return wrong values. Apply the usual disclaimers when using it.
#The function is slow (not optimized at all), so be patient with long lists of species.
#Author Ignasi Bartomeus (nacho.bartomeus#gmail.com). Last updated 23 Nov 2012.
#Usage:
is.invasive(sp, simplified.df = FALSE)
#Arguments:
#sp: a vector of species names in latin (Genus species)
#simplified.df: Returns a data.frame with the species name and the values "Invasive", "Not Invasive". I
#recomend to check first the not simplified version (default), which contains raw information about the
#level of invasiveness.
#The function:
is.invasive <- function(sp, simplified.df = FALSE){
require(plyr)
require(XML)
require(RCurl)
#reformat sp list
species <- gsub(" ","+",sp)
#create urls to parse
urls <- paste("http://www.issg.org/database/species/search.asp?sts=sss&st=sss&fr=1&x=13&y=9&sn=",
species,"&rn=&hci=-1&ei=-1&lang=EN", sep = "")
#create a data.frame to store the Output
Out <- data.frame(species = sp, status = c(1:length(urls)))
#loop through all species
for(i in 1:length(urls)){
#Parse url and extract table
doc <- htmlTreeParse(urls[i], useInternalNodes = TRUE)
tables <- getNodeSet(doc, "//table")
t <- readHTMLTable(tables[[4]])
tt <- as.matrix(t)
if(length(grep("No invasive species currently recorded",tt, value = TRUE)) > 0){
Out[i,2] <- "Not invasive"
}
else{
if(simplified.df == FALSE){Out[i,2] <- tt[12,1]}
else{Out[i,2] <- "Invasive"}
}
print(paste("Checking species", i+1))
}
print("Done")
Out
}
#Example:
sp <- c("Carpobrotus edulis", "Rosmarinus officinalis")
## first species is invasive, second one is not.
d <- is.invasive(sp)
d
d <- is.invasive(sp, simplified.df = TRUE)
d

view raw

is.invasive.R

hosted with ❤ by GitHub

Spanish researchers are moving north (and it’s not climate change)

No real post today… Too busy with the Ramon y Cajal fellowships. A tenure track without granted tenure even if you excel along the track. As always, a chaotic application web and poor information is the first selection process for the brave Spaniards willing to get back home… Good luck to everyone trying to complete the migration cycle!

Can niche and fitness differences explain biological invasions

Following up with my “Theory vs Data” post, I want to share an example of a beautiful theoretical framework to understand the invasion processes and an idea on which can be the perfect study system to validate it.

Mc Dougall et al (2009) have one of the more compelling figures I saw summarising the hypothesis that niche and competitive differences between exotic and native species can explain the outcome of the invasion process. The figure speaks for itself:

While I was in the US I planned to use this framework to understand the effects of Osmia cornifrons (a mason bee) invasion on the native Osmia lignaria, but I had no time to follow-up on this. Anyway, for that end you would need to prove the following:

1) Are their niches overlapping? Both bees are on the same genus, have similar size, phenology, nesting habits, and probably visit similar flowers, you just need to put numbers on those things (e.g. which hole diameter they prefer to nest on). For example, this data is from a preliminary experiments I did on its phenology. Interestingly, the result suggest the invader emerge slightly (but significantly) earlier than the native. So, quantifying all this can be important.

2) Is their fitness different when raised alone? Buying this bees and monitoring its nests is easy. Moreover, measuring offspring (a fairly good proxy of fitness) is a piece of cake compared with other species. Well, at least in theory, because I tried it in 2011 and an April snowstorm killed 80% of both populations. Hence, I have no data here.

3) It’s the native fitness lowered when they are raised together? That’s an important part (especially the effect size), because they may coexists just fine (even if sharing niches).

I am not in the US anymore, so, is impossible for me to do the experiments. If anyone wants to explore this idea further (undergraduates seeking for a project, jump in!), the idea is here, and it’s for free!

———————————————————————————————-
MacDougall A.S., Gilbert B. & Levine J.M. (2009). Plant invasions and the niche, Journal of Ecology, 97 (4) 609-615. DOI: ———————————————————————————————-

And now, what can occur with this post? 

– Worst thing it can happen is that nothing happens.

– Will be pretty cool if someone does this or similar experiments, even if I never know of its existence (well, I hope at least not to miss the article when it gets published!). I would be happy with that because despite I did some thinking on this I assume this ideas are “on the air”, and that’s precisely why I post them here.

– Will be awesome if that someone also contact me and we end up collaborating. (incentive: I have also some ideas on how to analyse it)

– Will be terrific (I am running out of superlatives) if people start reporting they have data on niche and fitness differences for other systems and we end up with a meta-analysis proving (or disproving) that this theory can correctly predict invasion outcome with some generality. For example, where is propagule pressure fitting in this framework? Niche and population growth/species traits hypothesis clearly are captured here, you can even account for lowered native fitness due to disturbance (wow!), but the number of invaders arriving may be a missing piece. Also scaling up to the community level seems a daunting task.

 

Context dependent

In the last meetings I attended, I observed an interesting behaviour among ecologists (including myself), and is that despite sometimes they present contradictory results, they get along pretty well. I understand that this is not the case among taxonomists, or physicists, where there is a single right answer (comic is not based on a true story). Ecologists can discuss several options regarding why the results presented are not general, but at the end, nobody claims to have the truth. Is there a “right answer” when understanding ecological processes? Is just that is hard to measure all the relevant variables, or even in the case where we can measure everything accurately, the stochasticity is too high?

I like to think that ecological theory is not only intellectually exciting, but that it allows for a general understanding of ecosystems. However, I keep finding context specific ecological responses everywhere, and few theories in ecology has a good predictive power. Maybe ecosystems are too complex to be predictable at fine scales. Maybe, like climatic models, we can predict next year general functioning of an ecosystem, but we can’t tell if a species will interact with another one next week. But maybe we just need to bring together better theory and better data and see if we can make sense of it. I am trying to put together data that usually is analyzed independently, but that is potentially affecting the same process. I hope that the combination of datasets fits better the theory than it does when data is analyzed independently. Despite stochasticity is everywhere, I want to think there is still room to improve the mechanistic understanding of complex ecosystems.