[R-SIG-Mac] install.packages

Seth Falcon sfalcon at fhcrc.org
Wed Jul 19 05:12:18 CEST 2006


Herve Pages <hpages at fhcrc.org> writes:

> Hi,
>
> Does anyone know why, on MacOS X, install.packages() is issuing this 
> warning:
>
>   number of rows of result
>           is not a multiple of vector length (arg 2) in: cbind(1, res0, 
> Repository = repos)
>
> when it's given a repos vector of length >= 4?

Actually, I think this occurs when a repository doesn't have any OSX
packages.  The lindsey repository has no OSX packages AFAIK.  You can
reproduce the warning using repos=repos[c(1, 5)].

The warning comes from available.packages (packages.R:67).

I suspect something like the following would be a reasonable fix:

--- a/src/library/utils/R/packages.R
+++ b/src/library/utils/R/packages.R
@@ -64,8 +64,10 @@ available.packages <-
                 on.exit()
             } # end of download vs cached
         } # end of localcran vs online
-        res0 <- cbind(res0, Repository = repos)
-        res <- rbind(res, res0)
+        if(length(res0)) {
+            res0 <- cbind(res0, Repository = repos)
+            res <- rbind(res, res0)
+        }
     }

I'm pretty sure this would come up for other platforms, it is just
more common for CRAN-style repositories to not have any OS X binaries
available.

Best,

+ seth



More information about the R-SIG-Mac mailing list