Re: [R] assistance with RDAtest beta version application

From: Guillaume Blanchet <>
Date: Thu, 27 Mar 2008 14:17:55 -0600

Hi !!

Stanfield, Les (MNR) a écrit :
> Thank you so much for coming to my rescue!:
> OK I have been able to open it (but only in the R editor. I assumed that we had to generate our own files of XX.txt and YY.txt and bring them into R before the program could run.... Is this right?

Yon do not have to, but you can. I personally like to import the whole file I'm working (here "Table_11-3.txt") and go from there. If you feel more comfortable to do it another way there is no problem there !
> So I created two as tab delimited text files (Here they are). I am able to bring them into R and when I edit them, they look fine.


> This is the code to this stage:
> rdaTest <- function(YY.mat, XX.mat, WW.mat=NULL,
> scale.Y=FALSE, testF=NULL, nperm=NULL, print.results=TRUE, print.cum=FALSE)
> {
> library(MASS)
> # Read the data tables. Transform them into matrices Y, X, and W
> YY.mat = -read.table("YY.txt")
> XX.mat = -read.table("XX.txt")
> Y.mat=as.matrix(YY.mat)
>> X.mat=as.matrix(XX.mat)
> bb<-edit(y.mat)
> bb<-edit(x.mat)
> But when I try to then convert these two files to mat files, nothing happens? I'm assuming it has something to do with this step, but I can't figure it out. Note: I tried creating base yy.mat and xx.mat files, by just changing the file names, but that didn't work.....
> So is this the problem, When I look at the y.mat and x.mat they look no different than the original txt files

Here I get a bit confused

Here is what I propose:

### Load the whole file

### Extract the species (Y) and the environmental variables (X) from tab11.3 Y<-tab11.3[,1:6]

### Calculate the RDA

### Draw the triplot

With these couple of lines you should get the same results as the ones presented in Legendre and Legendre (1998).

> Les Stanfield

Have a nice day !!

Guillaume Blanchet mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Thu 27 Mar 2008 - 20:20:34 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 27 Mar 2008 - 20:30:24 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive