[R-SIG-Mac] R.app Package Mgr Bug
James Eales
jeales at gmail.com
Wed Apr 16 12:06:45 CEST 2014
Unfortunately that didn't work for me, however I may have been doing it
wrong, I was using
assign(".find.package",func,envir=.GlobalEnv)
But I just looked at the R.app source
When we click "Package Manager"
it calls package.manager()
So you can just rewrite that function like this (notice the call to
.find.package is replaced with find.package)
I might try putting this in my profile
package.manager <- function ()
{
if (.Platform$GUI != "AQUA")
stop("this function is intended to work with the Aqua GUI")
loaded.pkgs <- .packages()
x <- library()
x <- x$results[x$results[, 1] != "base", ]
pkgs <- x[, 1]
pkgs.desc <- x[, 3]
is.loaded <- !is.na(match(pkgs, loaded.pkgs))
pkgs.status <- character(length(is.loaded))
pkgs.status[which(is.loaded)] <- "loaded"
pkgs.status[which(!is.loaded)] <- " "
pkgs.url <- file.path(find.package(pkgs), "html", "00Index.html")
load.idx <- .Call("pkgmanager", is.loaded, pkgs, pkgs.desc,
pkgs.url)
toload <- which(load.idx & !is.loaded)
tounload <- which(is.loaded & !load.idx)
for (i in tounload) {
cat("unloading package:", pkgs[i], "\n")
do.call("detach", list(paste("package", pkgs[i], sep = ":")))
}
for (i in toload) {
cat("loading package:", pkgs[i], "\n")
library(pkgs[i], character.only = TRUE)
}
}
On Tuesday, 15 April 2014 13:07:55 UTC+1, Witthoft, Carl G UTAS wrote:
>
> Just a thought, but what if you overload the defunct function in your
> .Globalenv ?
>
> .find.package<-function(package, lib.loc = NULL, quiet = FALSE,
> verbose = getOption("verbose") ) find.package(package,
> lib.loc , quiet, verbose)
>
> I don't know whether that workaround will be "recognized" by the package
> manager.
>
> Message: 1
> Date: Tue, 15 Apr 2014 04:17:24 -0700
> From: James Eales <jeales at gmail.com>
> To: <r-sig-mac at googlegroups.com>
> Cc: r-sig-mac at r-project.org
> Subject: Re: [R-SIG-Mac] R.app Package Manager Bug?
> Message-ID: <d5363dad-c90d-4277-a2de-e20ed2b272e9 at googlegroups.com>
> Content-Type: text/plain; charset="utf-8"
>
> +1
> I see this too, on both mavericks and ordinary mac build of R.app Its
> because R 3.1.0 has made ".find.package" a defunct function We'll need to
> wait for the R.app developers to change the code behind the package manager
> to use "find.package" instead of ".find.package"
> Hopefully it'll be a simple fix
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20140416/ef54ab7c/attachment-0001.html>
More information about the R-SIG-Mac
mailing list