After entering ?library(rpart)?, I tried to plot an existing rpart tree, and got this error message: Error: couldn't find function "plot.rpart". However, ??plot.rpart? does bring up the help for the function. The same things occur for text.rpart, although print(my.tree) does work. So, I tried to re-install rpart using Packages | Install from CRAN, but then I get this message:??????????????????????????????????????????????????-> local({a <- CRAN.packages()+ install.packages(select.list(a[,1],,TRUE), .libPaths()[1], available=a)}) trying URL `http://cran.r-project.org/bin/windows/contrib/1.7/PACKAGES' Content type `text/plain; charset=iso-8859-1' length 12560 bytes opened URL downloaded 12Kb trying URL `http://cran.r-project.org/bin/windows/contrib/1.7/rpart_3.1-12.zip' Content type `application/zip' length 231827 bytes opened URL downloaded 226Kb Error in unpackPkg(foundpkgs[okp, 2], pkgnames[okp], lib, installWithVers) : Can not remove prior installation of package ?????????????????????????????????????????????????????????????? Evidently I need to uninstall first, but I can?t figure out how. I?ve looked in the pdf manuals, in the R FAQ, and in the R for Windows FAQ, and don?t find instructions for doing so. I?d appreciate any help. Thanks. Dave Parkhurst
On Fri, 15 Aug 2003, David Parkhurst wrote:> > Error in unpackPkg(foundpkgs[okp, 2], pkgnames[okp], lib, installWithVers) : > > Can not remove prior installation of package >I have just experienced this when a previous instance of R did not shut down properly(*). The folder was locked and couldn't be deleted or renamed. My solution was to restart Windows. -thomas (*) This happens reproducibly when I use ESS with Xemacs on WinXP and open a graphics window.
On Fri, 15 Aug 2003, David Parkhurst wrote:> After entering ?library(rpart)?, I tried to plot an existing rpart tree, and > got this error message: Error: couldn't find function "plot.rpart". > However, ??plot.rpart? does bring up the help for the function. The same > things occur for text.rpart, although print(my.tree) does work.So have you *read* the help when you do ?plot.rpart ? Please read the example, and see how it is used. Hint: you do not use plot.rpart(), but plot() -- 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)
David Parkhurst wrote:> > After entering ?library(rpart)?, I tried to plot an existing rpart tree, and > got this error message: Error: couldn't find function "plot.rpart". > However, ??plot.rpart? does bring up the help for the function. The same > things occur for text.rpart, although print(my.tree) does work. > > So, I tried to re-install rpart using Packages | Install from CRAN, but > then I get this message:??????????????????????????????????????????????????- > > > local({a <- CRAN.packages() > > + install.packages(select.list(a[,1],,TRUE), .libPaths()[1], available=a)}) > > trying URL `http://cran.r-project.org/bin/windows/contrib/1.7/PACKAGES' > > Content type `text/plain; charset=iso-8859-1' length 12560 bytes > > opened URL > > downloaded 12Kb > > trying URL > `http://cran.r-project.org/bin/windows/contrib/1.7/rpart_3.1-12.zip' > > Content type `application/zip' length 231827 bytes > > opened URL > > downloaded 226Kb > > Error in unpackPkg(foundpkgs[okp, 2], pkgnames[okp], lib, installWithVers) : > > Can not remove prior installation of package > > ?????????????????????????????????????????????????????????????? > > Evidently I need to uninstall first, but I can?t figure out how. I?ve > looked in the pdf manuals, in the R FAQ, and in the R for Windows FAQ, and > don?t find instructions for doing so. I?d appreciate any help. Thanks. > > Dave ParkhurstSince Ko-Kang Kevin Wang already told that the usage of the generic plot() instead of its method plot.rpart() (same for text() and text.rpart(); interestingly you haven't tried print.rpart() instead of print()) is the solution of your first questions (for details see the article on Namespaces in the recent R News), let's take a look at the second: Windows locks DLLs that are in use, so I guess the package rpart was in use while you tried to reinstall. See the R for Windows FAQ 3.8 for details. You can uninstall packages manually as well: Just delete the packages directory (as the default, it's .../rw1071/library/PackageName). Uwe Ligges