[R-sig-eco] RDA with only dummy variable in environmental matrix

Zoltan Botta-Dukat bdz at botanika.hu
Tue Jun 22 08:52:38 CEST 2010

Dear Amelie,

Your three dummy variables should be changed to a factor with three 
levels (NAT, NR, REST). Function rda correctly handles the factor type 
environmental variables.

For plotting species names use this code:

rda.results = rda (mat.sp,mat.env)
plot(rda.results, scaling=1, type="points")

or simply


Best wishes


2010.06.21. 22:52 keltezéssel, amelie_can írta:
> Hello all,
> I want to do a redundancy analysis (rda). My response matrix is filled with
> species abundances (68 sites x 15 species). My environmental matrix (68
> sitex x 3 classes) is only filled with a dummy variable with three classes
> (NAT, NR, REST). Since dummy variables are linearly dependant, the variable
> REST is automatically removed but this does not result in any information
> loss as if a sites is not associated with NAT nor NR, it necessarily will be
> associated to REST. But I have three problems :
> 1)	For the moment, R only gives me a plot where NAT and NR are showed. I
> need to be able to show REST as well.
> 2)	My dummy variables are showed as arrows that are pointing to their
> centroid but I would like to only have the centroid (showed as any kind of
> shape).
> 3)	How can I add the species names (currently they are only represented by
> red cross). I tried the text function, but I could only add my sites names
> and not my species names.
> Following is an R example of my problem that you can easily run :
> library(vegan)
> mat.sp = matrix(c(40, 20, 37, 49, 52, 34, 35, 87, 90, 45, 49, 52, 34, 35,
> 87,5,39,99,8,45),nrow = 4, ncol=5, dimnames = list(c("sites1", "sites2",
> "sites3","sites4"),c("sp1", "sp2", "sp3", "sp4", "sp5")))
> mat.env = matrix(c(1,1,0,0,0,0,1,0,0,0,0,1),4,3, dimnames = list(c("sites1",
> "sites2", "sites3","sites4"),c("NAT", "NR", "REST")))
> rda = rda (mat.sp,mat.env)
> summary(rda)
> plot(rda, scaling=1, type="points")
> Thank you for any kind of assistance!

More information about the R-sig-ecology mailing list