EDIT in 2018 : More than two years later after this post, I just discover it back and realize how crazy I was to use R for Remote Sensing and for extracting ROI. I really suggest you to use Python or Orfeo Tool Box (Sample Extraction) to do this thing, and really not R !
R is a great tool for statistics, even if it may be slow in calculing raster’stats, it is really a good way for batching all of your work and presenting your data using MarkDown language. This example is one of my first autonomous script in R, and it is very exciting for further.
Report and scripts made during my last year placement at the Guiana Amazonian Park are on github.
Before showing you the different steps of the code, I need to present you the way I structured my data, because the script is going to parse them and to compile all tables in one file.