[R] Discriminant Correspondence Analysis
d.scott at auckland.ac.nz
Wed Dec 15 10:25:16 CET 2010
On 15/12/2010 9:36 a.m., Wayne Sawtell wrote:
> Hello everyone,
> I am totally new to the R program. I have had a look at some pdf documents
> that I downloaded and that explain how to do many things in R; however, I
> still cannot figure out how to do what I want to do, which is to perform
> Discriminant Correspondence Analysis on a rectangular matrix of data that I
> have in an Excel file. I know R users frown upon Excel and recommend
> converting Excel files to .csv format, which I have done, no problem. That
> is not an issue.
Actually one of the things we don't like about Excel is how it writes
.csv files, so many R users find it much more reliable to read data
directly from Excel files. In my case, the two major tools I use on
Windows with great satisfaction are xlsReadWrite and RODBC. There are
other suitable options if you are working on linux.
For more comprehensive information see:
> There are several parts to my problem.
> 1) When I try the read.table command, even if I include the directory name
> in the filename, R still cannot read the file, even if it is in .csv format
> 2) I was able to copy my file and then read the clipboard contents into R
> but then I do not know to assign a name to the data frame in order to
> conduct any operations on it
> 3) I need the ADE4 program in order to perform Discriminant Correspondence
> Analysis, so I used the "install.packages" command to install it. It
> installed no problem but I do not know how to access the ADE4 program in R.
> I am unable to open it directly, either.
> 4) I thought that using the ADE4 GUI (called "ade4TkGUI") would be easier
> because I do not know many of the R commands; but, again, I downloaded it
> but cannot open or access it.
> The following is the suggested coding that I found through the R website,
> but when I try to use this code, I don't know how to assign a name for the
> df, or what to put for "fac", and what is worse, I get an error message
> saying that the program cannot find the "discrimin.coa" command.
> discrimin.coa(df, fac, scannf = TRUE, nf = 2)
> df a data frame containing positive or null values
> fac a factor defining the classes of discriminant analysis
> scannf a logical value indicating whether the eigenvalues bar plot should be
> nf if scannf FALSE, an integer indicating the number of kept axes
> plot(discrimin.coa(perthi02$tab, perthi02$cla, scan = FALSE))
> For clarification, my data consists of measurements of morphological
> characters of an assemblage of biological specimens. I have already
> performed Principal Co-ordinates Analysis, Principal Compionents Analysis
> and Cluster Analysis in another program (PAST) in order to see if the data
> fall into distinct groupings that might represent different morphological
> species. I now want to test the groupings that I found on my test data set
> using Discriminant Correspondence Analysis.There are both continuous and
> categorical characters, which is the reason why I need to perform
> Discriminant Correspondence Analysis, instead of Linear Discriminant
> Analysis, which is only valid for continuous measurements. R seems to be the
> only program in which I can perform Discriminant Correspondence Analysis.
> Thanks for any help offered on any of these points.
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
David Scott Department of Statistics
The University of Auckland, PB 92019
Auckland 1142, NEW ZEALAND
Phone: +64 9 923 5055, or +64 9 373 7599 ext 85055
Email: d.scott at auckland.ac.nz, Fax: +64 9 373 7018
Director of Consulting, Department of Statistics
More information about the R-help