Skip to content

Have download.packages consider non-CRAN repositories

7 messages · Ingmar Schuster, Duncan Murdoch, Uwe Ligges

#
Hi List,

I've set up a CRAN-like repository (not a CRAN mirror) on the local
filesystem (this will change to http in the future). R has been told
about this repository using the following entry in
R_HOME/etc/repositories:
PMR2	PMR2	file:///Users/arbeit/Documents/clarin/Open_Science/PMR2/
TRUE    TRUE    FALSE   FALSE

Now I expected download.packages(), install.packages() etc. to look
for packages in "/Users/arbeit/Documents/clarin/Open_Science/PMR2/"
without passing them repos="file:///Users/..." as an option. That
doesn't happen and I'm not completely sure why. Did I misinterpret the
role of R_HOME/etc/repositories or is it possible I made a mistake?

A related question is this: my PMR2 repo provides source packages
only. Is there a way to tell a lokal R installation to look for source
packages _only_ for this specific repo and use binary packages for
CRAN?

Thanks a lot
Ingmar
#
I was not completely explicit on this part: everything works as
expected when I do pass repos="file:///Users/..." as an option. Only
I'm trying to eliminate the need for passing it.

Ingmar



2012/6/21 Ingmar Schuster <ingmar.schuster at informatik.uni-leipzig.de>:

  
    
#
On 12-06-21 5:58 AM, Ingmar Schuster wrote:
You need to set the "repos" option to change the default repository. 
The setRepositories() function does that using the file you edited.

Duncan Murdoch
#
2012/6/21 Duncan Murdoch <murdoch.duncan at gmail.com>:
setRepositories() shows my repo to be one of the defaults (this can be
set in the repositories file, which I did). Doesn't work anyway. One
strange thing though is that setRepositories() doesn't give the
correct name that I configured, just "NA".

Ingmar
#
On 21.06.2012 14:05, Duncan Murdoch wrote:
And note that is must be a complete repository, i.e. packages in subdir 
"./src/contrib". A user can use install.packages(....., type="source") 
if you do not provide binaries in case they are expected by default.

Uwe Ligges
1 day later
#
Hi Uwe and List,

Thanks for your suggestions.

It's a complete repository with source Packages and the PACKAGES(.gz)
index file under "src/contrib/". As mentioned: explicitly calling

install.packages("PACKAGE_NAME",
repos="file:///Users/arbeit/Documents/clarin/Open_Science/PMR2/",
type="source");

works without any problems. But configuring the repository through
R_HOME/etc/repositories and obmitting the repos argument to
install.packages() is what I want and what doesn't work. Ideas?
I knew about the type="source" argument to install.packages() but
hoped there would be a way to permanently configure this as default
for a source-only repository.


Thanks,
Ingmar Schuster
1 day later
#
On 22.06.2012 15:10, Ingmar Schuster wrote:
1. I haven't tried your syntax from above, but I'd rather use
  "file:/Users/arbeit/Documents/clarin/Open_Science/PMR2"
or under Windows in a safer way::
  "file:c:/Users/arbeit/Documents/clarin/Open_Science/PMR2"

2. Maybe you forgot to set the Repository active via setRepositories()?

3. Why don't you just set the repositories at startup, e.g. in 
Rprofile.site or your personal .Rprofile via:

local({
       r <- getOption("repos")
       r["myCRAN"] <- "file:////store/ligges/public_html/CRAN"
       options(repos=r)
})

works for me with store being a machine in the network (via UNC path).

Best,
uwe Ligges