[R] Problem on running update
Stephen Liu
satimis at yahoo.com
Mon Nov 22 05:26:02 CET 2010
Hi Martin,
Sorry I can't fix the update problem. Reading ?browser and ?recover didn't help
me out.
Finally I uninstalled R, 32/64 bit and RExcel and made a fresh installation of
them.
Remark:
I need to remove all folders with connection to them. Otherwise after
installing R, RExcel, rcom, statconnDCOM, R-commander, etc. I still encountered
the same problem.
After reinstalling above packages ran R as admin,
> update.packages()
--- Please select a CRAN mirror for use in this session ---
cluster :
Version 1.13.1 installed in C:/PROGRA~1/R/R-212~1.0/library
Version 1.13.2 available at http://cran.ms.unimelb.edu.au
Update (y/N/c)?
y
codetools :
Version 0.2-2 installed in C:/PROGRA~1/R/R-212~1.0/library
Version 0.2-5 available at http://cran.ms.unimelb.edu.au
Update (y/N/c)?
y
Matrix :
Version 0.999375-44 installed in C:/PROGRA~1/R/R-212~1.0/library
Version 0.999375-45 available at http://cran.ms.unimelb.edu.au
Update (y/N/c)?
y
mgcv :
Version 1.6-2 installed in C:/PROGRA~1/R/R-212~1.0/library
Version 1.7-2 available at http://cran.ms.unimelb.edu.au
Update (y/N/c)?
y
rpart :
Version 3.1-46 installed in C:/PROGRA~1/R/R-212~1.0/library
Version 3.1-47 available at http://cran.ms.unimelb.edu.au
Update (y/N/c)?
y
survival :
Version 2.35-8 installed in C:/PROGRA~1/R/R-212~1.0/library
Version 2.36-1 available at http://cran.ms.unimelb.edu.au
Update (y/N/c)?
y
trying URL
'http://cran.ms.unimelb.edu.au/bin/windows/contrib/2.12/cluster_1.13.2.zip'
Content type 'application/zip' length 370152 bytes (361 Kb)
opened URL
downloaded 361 Kb
trying URL
'http://cran.ms.unimelb.edu.au/bin/windows/contrib/2.12/codetools_0.2-5.zip'
Content type 'application/zip' length 42584 bytes (41 Kb)
opened URL
downloaded 41 Kb
trying URL
'http://cran.ms.unimelb.edu.au/bin/windows/contrib/2.12/Matrix_0.999375-45.zip'
Content type 'application/zip' length 3224889 bytes (3.1 Mb)
opened URL
downloaded 3.1 Mb
trying URL
'http://cran.ms.unimelb.edu.au/bin/windows/contrib/2.12/mgcv_1.7-2.zip'
Content type 'application/zip' length 894436 bytes (873 Kb)
opened URL
downloaded 873 Kb
trying URL
'http://cran.ms.unimelb.edu.au/bin/windows/contrib/2.12/rpart_3.1-47.zip'
Content type 'application/zip' length 191611 bytes (187 Kb)
opened URL
downloaded 187 Kb
trying URL
'http://cran.ms.unimelb.edu.au/bin/windows/contrib/2.12/survival_2.36-1.zip'
Content type 'application/zip' length 2619051 bytes (2.5 Mb)
opened URL
downloaded 2.5 Mb
package 'cluster' successfully unpacked and MD5 sums checked
package 'codetools' successfully unpacked and MD5 sums checked
package 'Matrix' successfully unpacked and MD5 sums checked
package 'mgcv' successfully unpacked and MD5 sums checked
package 'rpart' successfully unpacked and MD5 sums checked
package 'survival' successfully unpacked and MD5 sums checked
The downloaded packages are in
C:\Users\satimiswin764\AppData\Local\Temp\RtmpM8LYDq\downloaded_packages
>
Update is now working.
Lot of thanks for your detail advice and time spent.
B.R.
Stephen L
----- Original Message ----
From: Martin Morgan <mtmorgan at fhcrc.org>
To: Stephen Liu <satimis at yahoo.com>
Cc: r-help at r-project.org
Sent: Mon, November 22, 2010 10:55:20 AM
Subject: Re: [R] Problem on running update
On 11/21/2010 05:21 PM, Stephen Liu wrote:
> Hi Martin,
>
> Thanks for your advice.
>
> This is my first time hunting for cause of error on R.
Hi Stephen --
read the help pages ?browser, ?recover *before* trying to use the
commands ...
> ?browser
> ?recover
>
> Steps performed as follows;
>
>> Sys.glob(file.path(.libPaths()[1], "*", "DESCRIPTION"))
> [1] "C:\\Users\\satimis\\Documents/R/win-library/2.12/Ecdat/DESCRIPTION"
> [2]
>"C:\\Users\\satimis\\Documents/R/win-library/2.12/RColorBrewer/DESCRIPTION"
[snip]
> [36] "C:\\Users\\satimis\\Documents/R/win-library/2.12/tweedie/DESCRIPTION"
>>
>
>> traceback()
> 5: .readPkgDesc(lib, fields)
> 4: installed.packages(lib.loc = lib.loc)
> 3: NROW(instPkgs)
> 2: old.packages(lib.loc = lib.loc, contriburl = contriburl, method = method,
> available = available, checkBuilt = checkBuilt)
> 1: update.packages(repos = "http://cran.r-project.org")
>
> Enter a frame number, or 0 to exit
This says that the error occurred in the .readPkgDesc function; likely
one of your package 'DESCRIPTION' files is corrupt. Take a look at the
source of .readPkgDesc:
> utils:::.readPkgDesc
function (lib, fields, pkgs = list.files(lib))
{
ret <- matrix(NA_character_, length(pkgs), 2L + length(fields))
for (i in seq_along(pkgs)) {
pkgpath <- file.path(lib, pkgs[i])
if (file.access(pkgpath, 5L))
next
pkgpath <- file.path(pkgpath, "DESCRIPTION")
if (file.access(pkgpath, 4L))
next
desc <- tryCatch(read.dcf(pkgpath, fields = fields),
error = identity)
if (inherits(desc, "error") || NROW(desc) < 1L) {
warning(gettextf("read.dcf() error on file '%s'",
pkgpath), domain = NA, call. = FALSE)
next
}
desc <- desc[1L, ]
Rver <- strsplit(strsplit(desc["Built"], ";")[[1L]][1L],
"[ \t]+")[[1L]][2L]
desc["Built"] <- Rver
ret[i, ] <- c(sub("_.*", "", pkgs[i]), lib, desc)
}
ret[!is.na(ret[, 1L]), ]
}
<environment: namespace:utils>
you'll end up somewhere in the middle of this code. The variable 'pkgs'
will contain a vector of packages, and you'll likely be processing the
i'th package. So provoke the error
> options(error=recover)
> update.packages(repos="http://cran.r-project.org")
and when the bug occurs
> 1: update.packages(repos = "http://cran.r-project.org")
> 2: old.packages(lib.loc = lib.loc, contriburl = contriburl, method = method, a
> 3: NROW(instPkgs)
> 4: installed.packages(lib.loc = lib.loc)
> 5: .readPkgDesc(lib, fields)
>
> Selection:
indicate that you'd like to enter the 5th 'Selection'
> Selection: 5
You should see something like
Browse[1]>
you are 'inside' .readPkgDesc, so you can look around a little, e.g.,
Browse[1]> pkgs
Browse[1]> length(pkgs)
Browse[1]> i
Browse[1]> pkgs[i]
and with a little luck pkgs[i] will be the problem. It'll be located in
the directory
Browse[1]> lib
it would be helpful to look at the content of the DESCRIPTION file, to
understand what is wrong
Browse[1]> readLines(pkgpath)
If 'i' is 1 or length(pkgs) then it might pay to look around some more
-- these occur at the start and end of the loop in .readPkgDesc, so you
might be having problems in one of the surrounding lines.
To fix this, one might quit the browser
Browser[1]> Q
and quit recover
> Selection: 0
and reset how errors are handled
> options(error=NULL)
and use remove.packages() (see ?remove.packages) to remove the problem
package. Alternatively, you might find it necessary to use your
operating system to manually remove the directory in which the
DESCRIPTION file was found.
Include the output of
> sessionInfo()
to make sure you're using a recent version of R. Here's mine:
> sessionInfo()
R version 2.12.0 Patched (2010-11-21 r53647)
Platform: x86_64-unknown-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] tools_2.12.0
Martin
> starting httpd help server ... done
>
> Browser[1] ?recover
>
> Looked at them and wondered what to do next?
>
>
> B.R.
> Stephen L
>
>
>
> ----- Original Message ----
> From: Martin Morgan <mtmorgan at fhcrc.org>
> To: Stephen Liu <satimis at yahoo.com>
> Cc: r-help at r-project.org
> Sent: Mon, November 22, 2010 1:30:29 AM
> Subject: Re: [R] Problem on running update
>
> On 11/21/2010 03:12 AM, Stephen Liu wrote:
>> Hi Martin,
>>
>> Thanks for your advice.
>>
>> Ran following code on R-2.12.0 32bit as admin
>>
>>> for(lib in .libPaths()) {
>> + descs <- Sys.glob(file.path(lib, "*", "DESCRIPTION"))
>> + sizes <- file.info(descs)$size
>> + names(sizes) <- descs
>> + print(sizes[sizes < 100])
>> + }
>> named numeric(0)
>> named numeric(0)
>>
>> Where are the above files?
>
> If your problem was as a regular user, then run the above code as
> regular user not admin.
>
> Not sure what 'the above files' are that you are looking for; the 'named
> numeric(0)' says that no packages have DESCRIPTION files with size <
> 100; the loop looked in all directories in
>
> .libPaths()
>
> for a subdirectory with file DESCRIPTION; you can find these by for instance
>
> Sys.glob(file.path(.libPaths()[1], "*", "DESCRIPTION"))
>
> Your next step is to identify where the error is occurring; you might try
>
> update.packages(repos="http://cran.r-project.org")
>
> and when the error occurs use
>
> traceback()
>
> to understand the functions that are being called at the time of the
> error; the output of traceback() will be helpful to the list, even if
> not useful to you. The next step is likely to try to identify more
> precisely where the problem is, e.g.,
>
> options(error=recover)
> update.packages(repos="http://cran.r-project.org")
>
> and then following the instructions on ?recover and ?browser to more
> precisely identify the problem. Use options(error=NULL) to turn off
> recovery when done.
>
> Martin
>
>>
>>
>> B.R.
>> Stephen L
>>
>>
>>
>>
>> ----- Original Message ----
>> From: Martin Morgan <mtmorgan at fhcrc.org>
>> To: Stephen Liu <satimis at yahoo.com>
>> Cc: r-help at r-project.org
>> Sent: Sun, November 21, 2010 2:10:52 PM
>> Subject: Re: [R] Problem on running update
>>
>> On 11/20/2010 08:56 PM, Stephen Liu wrote:
>>> Hi folks,
>>>
>>> Win 7 64bit
>>> R 2.12.)
>>>
>>> Today on running:
>>>
>>>> update.packages()
>>> Error: subscript out of bounds
>>>
>>> Unable to proceed. I have been googling around and couldn't discover the
>>> cause. Pls help. TIA
>>
>> Hi Stephen -- maybe
>>
>> https://stat.ethz.ch/pipermail/r-help/2010-November/259912.html
>>
>> Martin
>>
>>>
>>>
>>> B.R.
>>> Stephen L
>>>
>>>
>>>
>>> ______________________________________________
>>> R-help at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>>
>>
>
>
--
Computational Biology
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109
Location: M1-B861
Telephone: 206 667-2793
More information about the R-help
mailing list