Practicals in strongRstrong - Universit#233; de Montr#233;al.pdfVIP

  • 19
  • 0
  • 约9.85万字
  • 约 49页
  • 2016-03-09 发布于广东
  • 举报

Practicals in strongRstrong - Universit#233; de Montr#233;al.pdf

Practicals using the R statistical language Pierre Legendre August 2005; May, July 2006 Département de sciences biologiques May, July, Nov. 2007; Jan., Feb., April, Aug., Oct. 2008 Université de Montréal February, March, April, May , June, July, August, Oct., Nov. 2009 September 2010, January 2011, July 2012, November 2012 0. R packages The following packages , available from CRAN, will be used in these practicals: ‘ade4’, ‘ape’, ‘cclust’, ‘cluster’, ‘FD’, ‘geoR’, ‘labdsv’, ‘mapdata’, ‘maps’, ‘mvpart’, ‘rgl’, ‘spam’, ‘spdep’, ‘vegan’. How to install packages from the CRAN is described in the document “Introduction_to R.pdf”. Then, download the ‘AEM, ‘packfor’ and ‘PCNM’ packages from the address http://r-forge.r- /R/?group_id=195 ; ‘rdaTest’ and ‘const.clust’ from ; and ‘STI’ from /site/miqueldecaceres/software. Other R-language functions, available on http:/, will also be used in the course. 1. Compute basic statistics in the R language: Robin data # Import the file ‘Robins.txt’ into an object ‘robin’ of type ‘data frame’ # You must first tell R what your working directory is. # Windows: File menu ⇒ Change dir... # Mac OSX: Misc. menu ⇒ Change Working Directory robin - read.table(Robins.txt) # or: robin = read.table(Robins.txt) # or else (better method): robin - read.table( file.choose() ) # This command opens a dialogue box # Check that the data have been read correctly robin # Copy the wing length values (first column) into an object ‘wing’: wing = robin[,1] wing # Print the contents of object wing is.vector(wing) is.matrix(wing) # Transform vector ‘wing’ into an object of type ‘matrix’ in case you need it later: wing.mat = as.matrix(wing) wing.mat is.vector(wing.ma

文档评论(0)

1亿VIP精品文档

相关文档