Hi Ben,
The documentation for ?.libPaths makes me think you might be able to
get somewhere by setting the Windows environment variables R_LIBS
and/or R_LIBS_USER. See also:
http://cran.r-project.org/bin/windows/base/rw-FAQ.html#Packages
Another option would be to create a user profile directly specify the
library path there. You can do this by creating and customizing the
Rprofile.site file or a .Rprofile file. See:
http://cran.r-project.org/doc/manuals/R-intro.html#Customizing-the-environment
I suspect, though I do not know, that the alternate library path
(which you do not want) was created because in Windows 7, the Program
directory requires elevated privileges. If you installed R in a
different directory (I typically use C:\R\), I think this problem
might go away (it's also easier to type if you're running any R
scripts etc. from the command prompt).
Cheers,
Josh
On Sun, Jan 2, 2011 at 11:35 AM, Chiquoine, Ben <BChiquoine at tiff.org>
wrote:> Hi,
>
>
>
> I just installed R on a new windows 7 machine and am having a probelm with
the default libraries. The default libraries are not what I want them to be so
when i say install.packages("XXX") the packages don't install
where I want them to. ?Ideally everything would install to the same location as
the base packages. When I look at my library paths I get the following.
>
>
>
>> .libPaths()
> [1] "C:\\Users\\Ben\\Documents/R/win-library/2.12"
> [2] "C:/PROGRA~1/R/R-212~1.1/library"
>
>
>
> if I type
>
>
>
>> .libPaths(.libPaths()[2])
>
>> .libPaths()
> [1] "C:/PROGRA~1/R/R-212~1.1/library"
>
> This is what I want it to say and packages are now installed where I want
them to be. ?Unfortunately when I restar R, .libPaths() defaults back to the
original two paths. So the real question is how do I permantly set my directory
to be the one in which the base files are installed?
>
> Thanks in advance for your help!
>
>
>
> Ben
>
> ___________________________________________
> This message and any attached documents contain
> information which may be confidential, subject to
> privilege or exempt from disclosure under applicable
> law. These materials are solely for the use of the
> intended recipient. If you are not the intended
> recipient of this transmission, you are hereby
> notified that any distribution, disclosure, printing,
> copying, storage, modification or the taking of any
> action in reliance upon this transmission is strictly
> prohibited. Delivery of this message to any person
> other than the intended recipient shall not
> compromise or waive such confidentiality, privilege
> or exemption from disclosure as to this
> communication.
>
> If you have received this communication in error,
> please notify the sender immediately and delete
> this message from your system.
>
> ? ? ? ?[[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
>
--
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/