[R] How to Perform CCA in ??!! Help please

stompper33 ascalderon03 at gmail.com
Wed Aug 18 15:27:46 CEST 2010


Ok..So here is an example of some of my code

Sites,P1,P2,P3,P4,P5,P6,P7,S1,S2,S3,S4,S4,S5
trap01,0,1,0,1,1,0,1,1,0,0,0,0
trap02,0,1,0,0,0,0,0,0,1,1,0,0
trap03,0,1,0,1,1,1,1,1,0,0,0,1
trap04,0,1,0,0,0,0,0,0,1,1,0,0
trap05,0,1,0,0,0,1,1,1,1,0,0,1

So here is a SMALL example of what the code looks like. The first row is
names of plant species and moth species. P1....P7 = plantSpecies, and
S1...S5 = mothSpecies. And the each of the rows that follow are presence and
absent data (1=present, 0=absent) for different trapping sites. (In reality
there are like 71 plant species, and over 450 moth species and 20 trap
sites)
So I've been trying to run CCA on this for a long time and keep getting
errors. I've been suggested to remove duplicate rows which I think I’ve done
(using 'unique' command...BUT what I was wondering is how can any rows be
duplicate if each row has a different trapID as the first item in each
row...or does R know to ignore this??) I have also been suggested to remove
any columns containing only 0s or 1s. I've done this also. Another
suggestion was Normalizing the data which I can normalize it using
"normalize"command but not sure if it is that simple. I am pasting my R
script. The only reason why I wanted to post my entire data was because
something is telling me with this small example data set that CCA may be
able to run successfully and I just really wanted to see if anyone can
really get it to go with my real data set. Like I said I've been trying this
for awhile. I am able to get the preliminary stages of CCA to work
(correlation matrices) but nothing else after that. So I will attach my
example data set and my R script I use. I will also attach my REAL data as
well for anyone who thinks they can solve this. It's probably something real
minor or small...that I'm just not seeing.

***IN the R Script you will need to change the csv file it reads in to
"example_data.csv" (this is the example data. ALSO the R script is ran for
the REAL data so it will need to be changed to work with the example_data.
While you're going through the script feel free to make note of errors I
could of made when writing up the script********

Thanks...thanks!!
http://r.789695.n4.nabble.com/file/n2329826/example_data.csv
example_data.csv 
http://r.789695.n4.nabble.com/file/n2329826/Performing_CCA_Script
Performing_CCA_Script 
http://r.789695.n4.nabble.com/file/n2329826/all_Data01.csv all_Data01.csv 
-- 
View this message in context: http://r.789695.n4.nabble.com/How-to-Perform-CCA-in-R-Help-please-tp2329336p2329826.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list