[R] Reading data for discriminant analysis

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Mar 9 18:14:53 CET 2000


> Date: Thu, 9 Mar 2000 08:52:40 -0800
> From: Clayton Springer <csprin at brandybuck.ca.sandia.gov>
> To: Peter Dalgaard BSA <p.dalgaard at biostat.ku.dk>, r-help at stat.math.ethz.ch
> 
> Peter,
> 
> > > I believe that the iris3 is rather special data format. 
> > > But I am unable to get a text file to become something like iris3.
> > > I would like to be able to formulate my data into a useable format. 
> > > What is the proper procedure to create iris3 from external sources.
> > 
> > library(MASS)
> > data(iris3)
> > 
> > (You need to install the VR bundle from CRAN first)
> 
> I have already done this. (I have successfully worked through the example.)
> What I would like to do is use myown data and work through a similar exercise.
> 

Then look at the other examples (in MASS3), such as

data(fgl)
fgl.lda <- lda(type ~ ., fgl)

fgl is a data frame, type is a factor.


dcrabs.lda <- lda(crabs$sex ~ FL + RW + CL + CW, lcrabs)

lcrabs is a data frame, crabs$sex is a factor.


The general form is factor ~ var1 + var2 + ... + varn

where vari had better be numerical variates.  There are first looked for
in the data frame supplied as the data argument, if any.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list