From maechler at stat.math.ethz.ch  Thu Nov 27 12:20:15 2008
From: maechler at stat.math.ethz.ch (maechler at stat.math.ethz.ch)
Date: Thu, 27 Nov 2008 12:20:15 +0100 (CET)
Subject: [Rd] Problem with installed.packages (PR#13332)
Message-ID: <20081127112015.3E711282C774@mail.pubhealth.ku.dk>

>>>>> "LH" == lhansen  <lhansen at blackmesacapital.com>
>>>>>     on Tue, 25 Nov 2008 23:30:23 +0100 (CET) writes:

    LH> Full_Name: Lars Hansen
    LH> Version: 2.8.0
    LH> OS: Linux
    LH> Submission from: (NULL) (70.90.201.133)


    LH> Hi,

    LH> Calling installed.packages() on a directory with only one package causes an
    LH> error if the priority argument is set to "NA":

    >> installed.packages(lib.loc = "/home/lhansen/R/libs", priority = "NA")
    LH> Error in mat[, "Package"] : incorrect number of dimensions

    LH> This seems like a classic dropping from matrix to vector bug. 

Yes, indeed, it is : forgetting to use  ', drop = FALSE'

    LH> Maybe the code

    LH> should be mat[, "Package", drop=FALSE].
no, it's here :

     mat <- mat[keep, , drop=FALSE]


This will be fixed in R-devel and R-patched within the next few
hours.

Thank you very much, Lars, for the bug report!
Martin Maechler, ETH Zurich



[Rd] Problem with installed.packages (PR#13332)
maechler at stat.math.ethz.ch