Nicolaas Busscher
2003-Aug-06 10:34 UTC
[R] problems with lda , data included, can somebody test with the new version
enclosed a simple R script (and a data file, and the output) , with calls lda similar to the example with the iris data in the documentation. it is not working and i dont understand the error message. can anybody help me? i am using R 1.5.1 (2002.06.17) on debian woody stable. I would like to avoid updating now, because i want to keep the system in "stable". can somebody test, if the newer version didnt have this problem ? thanks ------ data --------------- "diagonal.moment" "cluster.shade" "histogram.kurtosis" "assignment" "1" 91.966025 -11402.735755 -0.113658 "5" "2" 87.216671 -13892.812239 -0.106662 "5" "3" 94.23765 -12397.68244 -0.110086 "5" "4" 120.130753 -17229.165583 -0.119237 "5" "5" 84.952756 -13024.921078 -0.110119 "5" "6" 97.635587 -11984.989519 -0.103907 "5" "7" 60.416425 -8641.988229 -0.116222 "5" "8" 84.79081 -12332.977083 -0.1091 "5" "9" 78.408806 -11373.916988 -0.112666 "5" "10" 137.415571 -18491.889203 -0.118939 "5" "11" -10.156979 -1495.884639 -0.104795 "5" "12" 92.383809 -11601.060884 -0.11422 "5" "13" 147.584707 -19084.747951 -0.120416 "6" "14" 146.609465 -21629.814571 -0.121656 "6" "15" 143.91174 -19878.044959 -0.118049 "6" "16" 177.170923 -26024.777287 -0.121526 "6" "17" 134.00609 -18110.76336 -0.118185 "6" "18" 138.793062 -18347.029573 -0.121952 "6" "19" 125.658219 -16204.88335 -0.119324 "6" "20" 99.369435 -14246.410482 -0.122442 "6" "21" 154.763888 -21116.0578 -0.120623 "6" "22" 127.359594 -17490.575516 -0.120079 "6" "23" 136.568559 -18329.619348 -0.121503 "6" "24" 127.983753 -16243.10434 -0.121176 "6" ----- script: library(MASS) actaData<-read.table("actaData.dat") actaData ass<-actaData$assignment print(ass) tass<-table(ass) print(tass) #print(attributes(tass)) priodim<-attr(tass,"dim") prio=c(rep(1,priodim))/priodim print(prio) actaData z<-lda(assignment ~ .,actaData,prior=prio,tol=1.0e-08) --- end script--- start output: end output> print(dim(actaData))[1] 24 4> > ass<-actaData$assignment > print(ass)[1] 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6> tass<-table(ass) > print(tass)ass 5 6 12 12> #print(attributes(tass)) > priodim<-attr(tass,"dim") > prio=c(rep(1,priodim))/priodim > print(prio)[1] 0.5 0.5> > actaDatadiagonal.moment cluster.shade histogram.kurtosis assignment 1 91.96603 -11402.736 -0.113658 5 2 87.21667 -13892.812 -0.106662 5 3 94.23765 -12397.682 -0.110086 5 4 120.13075 -17229.166 -0.119237 5 5 84.95276 -13024.921 -0.110119 5 6 97.63559 -11984.990 -0.103907 5 7 60.41642 -8641.988 -0.116222 5 8 84.79081 -12332.977 -0.109100 5 9 78.40881 -11373.917 -0.112666 5 10 137.41557 -18491.889 -0.118939 5 11 -10.15698 -1495.885 -0.104795 5 12 92.38381 -11601.061 -0.114220 5 13 147.58471 -19084.748 -0.120416 6 14 146.60947 -21629.815 -0.121656 6 15 143.91174 -19878.045 -0.118049 6 16 177.17092 -26024.777 -0.121526 6 17 134.00609 -18110.763 -0.118185 6 18 138.79306 -18347.030 -0.121952 6 19 125.65822 -16204.883 -0.119324 6 20 99.36943 -14246.410 -0.122442 6 21 154.76389 -21116.058 -0.120623 6 22 127.35959 -17490.576 -0.120079 6 23 136.56856 -18329.619 -0.121503 6 24 127.98375 -16243.104 -0.121176 6> > z<-lda(assignment ~ .,actaData,prior=prio,tol=1.0e-08)Error in scale(group.means, center = xbar, scale = FALSE) : unused argument(s) (center ...) Execution halted #----------------------------------------- ### output from R --version R 1.5.1 (2002-06-17). Copyright (C) 2002 R Development Core Team R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under the terms of the GNU General Public License. For more information about these matters, see http://www.gnu.org/copyleft/gpl.html. ------------------- Dr.Nicolaas Busscher Universit?t GH Kassel Nordbahnhofstrasse: 1a, D-37213 Witzenhausen Phone: 0049-(0)5542-98-1715, Fax: 0049-(0)5542-98-1713
Ko-Kang Kevin Wang
2003-Aug-06 10:50 UTC
[R] problems with lda , data included, can somebody test with the new version
On Wed, 6 Aug 2003, Nicolaas Busscher wrote:> enclosed a simple R script (and a data file, and the output) , with > calls lda similar to the example with the iris data in the > documentation. it is not working and i dont understand the error > message. can anybody help me? i am using R 1.5.1 (2002.06.17) on > debian woody stable. > > I would like to avoid updating now, because i want to keep the system > in "stable". can somebody test, if the newer version didnt have this > problem ? thanks > > z<-lda(assignment ~ .,actaData,prior=prio,tol=1.0e-08)Using the latest version, R 1.7.1, I get:> zCall: lda.formula(assignment ~ ., data = actaData, prior = prio, tol = 1e-08) Prior probabilities of groups: 5 6 0.5 0.5 Group means: diagonal.moment cluster.shade histogram.kurtosis 5 84.94982 -11989.17 -0.1116342 6 138.31495 -18892.15 -0.1205776 Coefficients of linear discriminants: LD1 diagonal.moment -1.575854e-03 cluster.shade -1.209398e-04 histogram.kurtosis -2.028278e+02 -- Cheers, Kevin ------------------------------------------------------------------------------ "On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." -- Charles Babbage (1791-1871) ---- From Computer Stupidities: http://rinkworks.com/stupid/ -- Ko-Kang Kevin Wang Master of Science (MSc) Student SLC Tutor and Lab Demonstrator Department of Statistics University of Auckland New Zealand Homepage: http://www.stat.auckland.ac.nz/~kwan022 Ph: 373-7599 x88475 (City) x88480 (Tamaki)
Prof Brian Ripley
2003-Aug-06 11:01 UTC
[R] problems with lda , data included, can somebody test with the new version
On Wed, 6 Aug 2003, Nicolaas Busscher wrote:> enclosed a simple R script (and a data file, and the output) , with > calls lda similar to the example with the iris data in the > documentation. it is not working and i dont understand the error > message. can anybody help me? i am using R 1.5.1 (2002.06.17) on > debian woody stable. > > I would like to avoid updating now, because i want to keep the system > in "stable". can somebody test, if the newer version didnt have this > problem ? thanksNotice the error is from scale(), and that has not been changed for 18 months. Your session appears to have a corrupt version of scale, and perhaps you ought to use a clean session and R --vanilla to help you find your problem.> > z<-lda(assignment ~ .,actaData,prior=prio,tol=1.0e-08) > Error in scale(group.means, center = xbar, scale = FALSE) : > unused argument(s) (center ...) > Execution haltedBTW, your code does work in current R. -- 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 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Philippe Glaziou
2003-Aug-06 11:06 UTC
[R] problems with lda , data included, can somebody test with the new version
Nicolaas Busscher <busscher at wiz.uni-kassel.de> wrote:> enclosed a simple R script (and a data file, and the > output) , with calls lda similar to the example with the > iris data in the documentation. it is not working and i > dont understand the error message.I tested your data and commands without any error message on a linux debian distribution:> [...] > z<-lda(assignment ~ .,actaData,prior=prio,tol=1.0e-08) > zCall: lda.formula(assignment ~ ., data = actaData, prior = prio, tol = 1e-08) Prior probabilities of groups: 5 6 0.5 0.5 Group means: diagonal.moment cluster.shade histogram.kurtosis 5 84.94982 -11989.17 -0.1116342 6 138.31495 -18892.15 -0.1205776 Coefficients of linear discriminants: LD1 diagonal.moment -1.575854e-03 cluster.shade -1.209398e-04 histogram.kurtosis -2.028278e+02> can anybody help me? i am using R 1.5.1 (2002.06.17) on > debian woody stable. I would like to avoid updating now, > because i want to keep the system in "stable".You can upgrade your old R while keeping the system in stable. You may download the 1.7.1 deb packages from CRAN, and install them with dpkg. Or even better, you can create your own debs from the sources, all the required files are the package. tar xvzf R-1.7.1.tgz cd R-1.7.1 dpkg-buildpackage -rfakeroot And a few coffees later, you will find a fairly large number of deb files in the parent directory. -- Philippe