Bug 14042 - error in install.packages()
error in install.packages()
Status: CLOSED FIXED
Product: R
Classification: Unclassified
Component: Misc
old
ix86 (32-bit) Windows 32-bit
: P5 normal
Assigned To: Jitterbug compatibility account
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-11-04 22:04 UTC by Jitterbug compatibility account
Modified: 2009-11-04 22:47 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jitterbug compatibility account 2009-11-04 22:04:10 UTC
From: michael.m.spiegel@gmail.com
Full_Name: Michael Spiegel
Version: 2.10
OS: Windows Vista
Submission from: (NULL) (76.104.24.156)


The following error is produced when attempting to call install.packages.  Here
is the results of the traceback:

> source('http://openmx.psyc.virginia.edu/getOpenMx.R')
Error in f(res) : invalid subscript type 'list'
> traceback()
7: f(res)
6: available.packages(contriburl = contriburl, method = method)
5: .install.winbinary(pkgs = pkgs, lib = lib, contriburl = contriburl, 
       method = method, available = available, destdir = destdir, 
       dependencies = dependencies, ...)
4: install.packages(pkgs = c("OpenMx"), repos = repos)
3: eval.with.vis(expr, envir, enclos)
2: eval.with.vis(ei, envir)
1: source("http://openmx.psyc.virginia.edu/getOpenMx.R")

I've tracked the error down to somewhere in available.packages defined in
src\library\utils\R\packages.R.  I am guessing that the error in version 2.10
has something to do with the change: "available.packages() gains a 'filters'
argument for specifying the filtering operations performed on the packages found
in the repositories."

Comment 1 Jitterbug compatibility account 2009-11-04 22:40:16 UTC
From: Duncan Murdoch <murdoch@stats.uwo.ca>
On 11/4/2009 11:05 AM, michael.m.spiegel@gmail.com wrote:
> Full_Name: Michael Spiegel
> Version: 2.10
> OS: Windows Vista
> Submission from: (NULL) (76.104.24.156)
> 
> 
> The following error is produced when attempting to call install.packages.  Here
> is the results of the traceback:
> 
>> source('http://openmx.psyc.virginia.edu/getOpenMx.R')
> Error in f(res) : invalid subscript type 'list'
>> traceback()
> 7: f(res)
> 6: available.packages(contriburl = contriburl, method = method)
> 5: .install.winbinary(pkgs = pkgs, lib = lib, contriburl = contriburl, 
>        method = method, available = available, destdir = destdir, 
>        dependencies = dependencies, ...)
> 4: install.packages(pkgs = c("OpenMx"), repos = repos)
> 3: eval.with.vis(expr, envir, enclos)
> 2: eval.with.vis(ei, envir)
> 1: source("http://openmx.psyc.virginia.edu/getOpenMx.R")
> 
> I've tracked the error down to somewhere in available.packages defined in
> src\library\utils\R\packages.R.  I am guessing that the error in version 2.10
> has something to do with the change: "available.packages() gains a 'filters'
> argument for specifying the filtering operations performed on the packages found
> in the repositories."
> 

I can reproduce this, and yes, it is happening in one of the filters. 
I'd guess it happens because your repository has only one entry (a 
missed "drop=FALSE" somewhere maybe) or because the filter is finding no 
matches.  I'll track down the details and fix it.

Thanks for the report.

Duncan Murdoch

Comment 2 Jitterbug compatibility account 2009-11-04 22:47:09 UTC
From: Duncan Murdoch <murdoch@stats.uwo.ca>
On 11/4/2009 11:05 AM, michael.m.spiegel@gmail.com wrote:
> Full_Name: Michael Spiegel
> Version: 2.10
> OS: Windows Vista
> Submission from: (NULL) (76.104.24.156)
> 
> 
> The following error is produced when attempting to call install.packages.  Here
> is the results of the traceback:
> 
>> source('http://openmx.psyc.virginia.edu/getOpenMx.R')
> Error in f(res) : invalid subscript type 'list'
>> traceback()
> 7: f(res)
> 6: available.packages(contriburl = contriburl, method = method)
> 5: .install.winbinary(pkgs = pkgs, lib = lib, contriburl = contriburl, 
>        method = method, available = available, destdir = destdir, 
>        dependencies = dependencies, ...)
> 4: install.packages(pkgs = c("OpenMx"), repos = repos)
> 3: eval.with.vis(expr, envir, enclos)
> 2: eval.with.vis(ei, envir)
> 1: source("http://openmx.psyc.virginia.edu/getOpenMx.R")
> 
> I've tracked the error down to somewhere in available.packages defined in
> src\library\utils\R\packages.R.  I am guessing that the error in version 2.10
> has something to do with the change: "available.packages() gains a 'filters'
> argument for specifying the filtering operations performed on the packages found
> in the repositories."

I've found the error, and will fix and commit to R-devel and R-patched.

For future reference:  the problem was that it assigned the result of 
sapply() to a subset of a vector.  Normally sapply() simplifies its 
result to a vector, but in this case the result was empty, so sapply() 
returned an empty list; assigning a list to a vector coerced the vector 
to a list, and then the "invalid subscript type 'list'" came soon after.

Duncan Murdoch

Comment 3 Jitterbug compatibility account 2009-11-06 22:52:00 UTC
NOTES:
 Fixed in 2.10.0 patched
Comment 4 Jitterbug compatibility account 2009-11-06 22:52:06 UTC
Audit (from Jitterbug):
Fri Nov  6 16:52:06 2009	ripley	changed notes
Fri Nov  6 16:52:06 2009	ripley	moved from incoming to Misc-fixed