====== R Stuff ====== [[http://www.r-project.org|{{:tutoriais:rlogo-4.png }}]] Some R-codes, class notes and tutorials produced by our team and collaborators. Hopefully part of them will become R-packages and printed publications in a near future. Meanwhile we are glad to share them as they are, of course without any warranty that they are all running properly. Your feedback is very welcome. ===== R programing and modelling ===== * [[http://ecologia.ib.usp.br/bie5782/doku.php?id=bie5782:03_apostila:start|On line introductory R manual]], from our graduate course on using R in ecology. In portuguese. * [[http://ecologia.ib.usp.br/bie5782/doku.php?id=bie5782:02_tutoriais:start|Tutorials on basic use of the R environment]], from our graduate course on using R in ecology. In portuguese. * [[tutoriais:tut-mod|quick R tutorial on model fiting]] by the maximum likelihood method. In portuguese. * [[http://ecologia.ib.usp.br/bie5782/doku.php?id=bie5782:02_tutoriais:start|Our gradute course on statistical modelling]]: nice R tutorials and study notes. In portuguese. ===== Species Abundance Distributions ===== These codes are part of an [[projetos:sad|ongoing research project]] on developing a protocol to fit by maximum likelihood and to compare by model selection different SAD models. ==== Fisher Logseries ==== The original numerical recipe proposed by Fisher et al. (1943) to fit the Fisher logseries to abundance data is a maximum likelihood method (Alonso et al 2008). Above functions to fit the logseries which return the likelihood and AIC. Also funtions for ploting the predicted abundances in a rank-abundance plot, and for the PDF (original discrete form and the continuous approximation by Green & Plotkin 2007) and CDF of the logseries. * {{:tutoriais:funcoes_logser.r|R code - logseries}} ==== Lognormal ==== Codes to CDFs and PDFs of the truncated lognormal and their resulting random sampling model, the Poisson-Lognormal (Bulmer 1974), which takes advantage of the [[http://finzi.psych.upenn.edu/R/library/poilog/html/00Index.html|poilog]] R package (Grøtan & Engen, 2008). * {{:tutoriais:funcoes_lognormal.r|R code - lognormal}} * [[http://cmq.esalq.usp.br/LCF5877/doku.php?id=02-continuas:02-continuas#distribuicao_log-normal| R tutorial on population dynamics and lognormal]], from our [[http://cmq.esalq.usp.br/LCF5877/|graduate course on statistical modelling]] (in portuguese). A very basic demonstration on how populations under uncoupled stochastic dynamics can generate a lognormal SAD. ==== Niche-Partitioning models ==== Currently just simple functions for the expected abundances for the i-th species in a rank-abundance plot for the Geometric (Motomura 1932) and Broken-Stick (MacArthur 1960) models. * {{:tutoriais:funcoes_niche_part.r|R Code - Geometric and Brokenstick}} ==== Rank-abundance Plots ==== {{:tutoriais:rank_ab.png?250 |outuput of the ''radplot'' function }}These functions plot rank-abundance plots and allow to compare visually the fit of the four classical models. * {{:tutoriais:rankplots.r|R code - Rank-abundance plots}} ==== Supporting Documentation ==== * {{:tutoriais:quick_example.r|A quick example code}} for the use of the functions of this section. * {{:didatico:quantif:pratica1.pdf|A tutorial in R for the use of the functions of this section}}, from a graduate course (in portuguese). * [[tutoriais:tut-sampling-sad| A online tutorial in R about sampling theory of SADs]] (in portuguese) ===== Additive Diversity Partitioning ===== The R package vegan has [[http://cc.oulu.fi/~jarioksa/softhelp/vegan/html/adipart.html|functions]] for individual-based permutation tests of additive diversity partitioning (//sensu// Crist et al. 2003). Here we provide a code for the sample-based tests (Crist et al. 2003), where sample units of a given level are shuffled within units of the level above. This code is an improved version of those used by Ribeiro et al. (2008). Apart code fine-tuning, the main change is that the average diversity indexes are not weighted (see Crist et al. 2003). * {{:tutoriais:funcoes_partition.r|R code - Sample-based partition test}} * {{:didatico:quantif:bird.csv|Test data: birds in South Bahia}} (Pardini //et al.// 2009). * {{:tutoriais:partition_example.txt|Results of analysis of test data}} * {{:didatico:quantif:pratica_part.pdf|An introductory tutorial in R}} of additive diversity partitioning, from a graduate course (in portuguese). ===== References ===== @ARTICLE{Alonso2008, author = {Alonso, D and Ostling, A and Etienne, R S}, title = {The implicit assumption of symmetry and the species abundance distribution}, journal = {Ecology Letters}, year = {2008}, volume = {11}, pages = {93-105}, url={http://www3.interscience.wiley.com/journal/119419803/suppinfo|SOM} } @ARTICLE{bulmer1974, author = {Bulmer, M. G.}, title = {On fitting the Poisson lognormal distribution to species abundance data}, journal = {Biometrics}, year = {1974}, volume = {30}, pages = {651-660}, owner = {paulo}, timestamp = {2009.04.12} } @article{crist2003, title={Partitioning species diversity across landscapes and regions: a hierarchical analysis of $$\alpha$$, $$\beta$$, and $$\gamma$$ diversity}, author={Crist, T.O. and Veech, J.A. and Gering, J.C. and Summerville, K.S.}, journal={The American Naturalist}, volume={162}, pages={734--743}, year={2003}, publisher={Univ. Chicago Press} } @ARTICLE{fisher1947, author = {Fisher, R.A. and Corbet, A.S. and Williams, C.B.}, title = {The relation between the number of the species and the number of individuals in a random sample from animal population}, journal = {Journal of Animal Ecology}, year = {1943}, volume = {12}, pages = {42-58}, owner = {paulo}, timestamp = {2009.04.12} } @ARTICLE{Green2007, author = {Jessica L. Green and Joshua B. Plotkin}, title = {A statistical theory for sampling species abundances}, journal = {Ecology Letters}, year = {2007}, volume = {10}, pages = {1037 - 1045}, owner = {paulo}, timestamp = {2008.12.16}, url={http://www3.interscience.wiley.com/journal/118545784/suppinfo} } @Manual{grotan2008, title = {poilog: Poisson lognormal and bivariate Poisson lognormal distribution}, author = {Vidar Grøtan and Steinar Engen}, year = {2008}, note = {R package version 0.4}, url={http://finzi.psych.upenn.edu/R/library/poilog/html/00Index.html} } @ARTICLE{MacArthur1960, author = {MacArthur, R. H.}, title = {On the relative abundance of species}, journal = {American Naturalist}, year = {1960}, volume = {94}, pages = {25-36}, owner = {paulo}, timestamp = {2009.04.11} } @ARTICLE{Motomura1932, author = {I Motomura}, title = {On the statistical treatment of communities}, journal = {Zoological Magazine, Tokyo}, year = {1932}, volume = {44}, pages = {379-383}, owner = {paulo}, timestamp = {2009.04.14} } @ARTICLE{pardini2009, author = {Pardini, R. and Faria, D. and Accacio, G.M. and Laps, R.R. and Mariano-Neto, E. and Paciencia, M.L.B. and Dixo, M. and Baumgarten, J.}, title = {The challenge of maintaining Atlantic forest biodiversity: A multi-taxa conservation assessment of specialist and generalist species in an agro-forestry mosaic in southern Bahia}, journal = {Biological Conservation}, year = {2009}, volume = {142}, pages = {1178--1190}, number = {6}, publisher = {Elsevier} } @ARTICLE{ribeiro2008, author = {Ribeiro, D.B. and Prado, P.I. and Brown Jr, K.S. and Freitas, A.V.L.}, title = {Additive partitioning of butterfly diversity in a fragmented landscape: importance of scale and implications for conservation}, journal = {Diversity and Distributions}, year = {2008}, volume = {14}, pages = {961--968}, number = {6}, publisher = {John Wiley \& Sons}, file={:prado:ribeiro2008.pdf} }