Re: [R] Setting hostname in the .Renvironment

2011-11-21 Thread Uwe Ligges



On 21.11.2011 01:32, Jonathan Greenberg wrote:

This is a follow-up to a question I asked a few years back.  We have a pair
of computers that share a common home directory (and therefor a common
.Renviron) with identical hardware, but very different sets of libraries
such that using a shared R_LIBS between two computers does not work.
  They both use this as the default library for user installations:

'~/R/x86_64-pc-linux-gnu-library/2.13'

I would like to mod the .Renviron in such a way so

'~/R/hostname-1/x86_64-pc-linux-gnu-library/2.13'
'~/R/hostname-2/x86_64-pc-linux-gnu-library/2.13'

How can I modify my R_LIBS_USER in the .Renviron to match this?  The
hostname would need to be dynamically set based on which computer I log
into, but I tried something like this:

R_LIBS_USER=~/lib/R/library/$HOSTNAME_%p_%a_%o_R%V




Depends on the shells you are using and where it is defined, but you 
definitely need braces rather than quotes as in:



R_LIBS_USER=~/lib/R/library/${HOSTNAME}


and I have to

export HOSTNAME ${HOSTNAME}

at first on the machines I am using to have it accessible for R.

Best,
Uwe Ligges





and R did not resolve the $HOSTNAME environment variable even though I can
(from bash) echo $HOSTNAME and it return the correct name.

Thoughts?  Thanks!

--j




__
R-help@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.


[R] Setting hostname in the .Renvironment

2011-11-20 Thread Jonathan Greenberg
This is a follow-up to a question I asked a few years back.  We have a pair
of computers that share a common home directory (and therefor a common
.Renviron) with identical hardware, but very different sets of libraries
such that using a shared R_LIBS between two computers does not work.
 They both use this as the default library for user installations:

'~/R/x86_64-pc-linux-gnu-library/2.13'

I would like to mod the .Renviron in such a way so

'~/R/hostname-1/x86_64-pc-linux-gnu-library/2.13'
'~/R/hostname-2/x86_64-pc-linux-gnu-library/2.13'

How can I modify my R_LIBS_USER in the .Renviron to match this?  The
hostname would need to be dynamically set based on which computer I log
into, but I tried something like this:

R_LIBS_USER=~/lib/R/library/$HOSTNAME_%p_%a_%o_R%V

and R did not resolve the $HOSTNAME environment variable even though I can
(from bash) echo $HOSTNAME and it return the correct name.

Thoughts?  Thanks!

--j


-- 
Jonathan A. Greenberg, PhD
Assistant Professor
Department of Geography
University of Illinois at Urbana-Champaign
607 South Mathews Avenue, MC 150
Urbana, IL 61801
Phone: 415-763-5476
AIM: jgrn307, MSN: jgrn...@hotmail.com, Gchat: jgrn307, Skype: jgrn3007
http://www.geog.illinois.edu/people/JonathanGreenberg.html

[[alternative HTML version deleted]]

__
R-help@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.