[Rd] utils::setRepositories bug when adding a local repository? (PR#7810)

john.gavin at ubs.com john.gavin at ubs.com
Sun Apr 24 17:41:45 CEST 2005


Full_Name: John Gavin
Version: 2.1.0 patched 18-04-05
OS: windows XP SP2
Submission from: (NULL) (139.149.1.203)


Hi,

I suspect that there may be a bug in utils::setRepositories().

Starting with

> getOption("repos")
                                CRAN                            CRANextra 
                            "@CRAN@" "http://www.stats.ox.ac.uk/pub/RWin" 

I set

> options(repos = c(
+  UBS = "http://wfdevapps:8150/qrms/r",
+   CRAN = "http://cran.uk.r-project.org",
+   CRANextra = "http://www.stats.ox.ac.uk/pub/RWin",
+   Omegahat = "http://www.omegahat.org/R"
+ ))
> getOption("repos")
                                 UBS                                 CRAN 
      "http://wfdevapps:8150/qrms/r"       "http://cran.uk.r-project.org" 
                           CRANextra                             Omegahat 
"http://www.stats.ox.ac.uk/pub/RWin"          "http://www.omegahat.org/R" 
> 

now when I run 'utils::setRepositories' I see

> utils::setRepositories()
Error in xi[[j]] : subscript out of bounds
In addition: Warning message:
longer object length
        is not a multiple of shorter object length in: clabs == nmi 

Examining that function via 'debug'

Browse[1]> a
              menu_name                                URL default source
CRAN               CRAN       http://cran.uk.r-project.org    TRUE   TRUE
CRANextra CRAN (extras) http://www.stats.ox.ac.uk/pub/RWin    TRUE  FALSE
BioC       Bioconductor        http://www.bioconductor.org   FALSE   TRUE
Omegahat       Omegahat          http://www.omegahat.org/R    TRUE   TRUE

Browse[1]> newa
    menu_name                          URL default
UBS       UBS http://wfdevapps:8150/qrms/r    TRUE

The 'source' column is present in 'a' but not in 'newa'.
This causes the error when they are merged via 'rbind'

Browse[1]>  rbind(a, newa)
Error in xi[[j]] : subscript out of bounds
In addition: Warning message:
longer object length
        is not a multiple of shorter object length in: clabs == nmi 

Artifically adding a 'source = FALSE' column to 'a' 
seems to fix the problem.

Browse[1]> newa <- data.frame(menu_name = aa, URL = repos[new], default = TRUE,
source = FALSE)
Browse[1]> row.names(newa) <- aa
Browse[1]>  rbind(a, newa)
              menu_name                                URL default source
CRAN               CRAN       http://cran.uk.r-project.org    TRUE   TRUE
CRANextra CRAN (extras) http://www.stats.ox.ac.uk/pub/RWin    TRUE  FALSE
BioC       Bioconductor        http://www.bioconductor.org   FALSE   TRUE
Omegahat       Omegahat          http://www.omegahat.org/R    TRUE   TRUE
UBS                 UBS       http://wfdevapps:8150/qrms/r    TRUE  FALSE
Browse[1]> a <- rbind(a, newa)
...

producing the output

exiting from: utils::setRepositories()
$repos
                                 UBS                                 CRAN 
      "http://wfdevapps:8150/qrms/r"       "http://cran.uk.r-project.org" 
                           CRANextra                             Omegahat 
"http://www.stats.ox.ac.uk/pub/RWin"          "http://www.omegahat.org/R" 


> version
         _              
platform i386-pc-mingw32
arch     i386           
os       mingw32        
system   i386, mingw32  
status   Patched        
major    2              
minor    1.0            
year     2005           
month    04             
day      18             
language R          


Regards,

John.

John Gavin <john.gavin 'at' ubs 'dot' com>,
Quantitative Risk Models and Statistics,
UBS Investment Bank, 6th floor, 
100 Liverpool St., London EC2M 2RH, UK.
Phone +44 (0) 207 567 4289
Fax   +44 (0) 207 568 5352



More information about the R-devel mailing list