[Rd] problem with tilde expansion in install.packages

Peter Dalgaard p.dalgaard at biostat.ku.dk
Wed Jun 23 17:51:18 CEST 2004


"Roger D. Peng" <rpeng at jhsph.edu> writes:

> I didn't compile this version of R myself but I believe readline is
> compiled in -- the command history works and:
> 
>  > capabilities("cledit")
> cledit
>    TRUE
> 
> Also,
> 
>  > Sys.getenv("HOME")
>                    HOME
> "/users/student/rpeng"
> 
> which is in fact my home directory.

I think sufficiently braindead versions of sh just will do this to you,
including the one that comes default on Solaris 9:

rasch:~/>/usr/bin/sh
$ ls ~
~: No such file or directory

This applies also to system() processing, e.g. 

system("mkdir -p ~/xxx") 

gets you a directory "~" with subdir "xxx". (NB: If you try this,
think VERY carefully about how to remove that dir!!!!)

> Prof Brian Ripley wrote:
> > Do you have readline working on that version of R?  If so, it is
> > readline problem.  If not, do you have HOME set? - if not, try
> > setting it.
> > On Wed, 23 Jun 2004, Roger D. Peng wrote:
> >
> >> In R 1.9.0 on Solaris/Sparc when I run, for example,
> >> install.packages("gregmisc", "~/R-local/lib"), instead of
> >> installing the `gregmisc' package in the directory
> >> /users/student/rpeng/R-local/lib the package gets installed in
> >> /users/student/rpeng/\~/R-local/lib, so the directory \~ is created
> >> in my home directory.  This doesn't happen to me on Linux or
> >> Windows so I thought it might not be an R problem.
> >>
> >> I realize I'm referring to an older version of R but I was
> >> wondering if anyone had seen this happen (perhaps on 1.9.1) or how
> >> I might better pinpoint the problem.
> >>
> >> > version
> >>          _
> >>platform sparc-sun-solaris2.8
> >>arch     sparc
> >>os       solaris2.8
> >>system   sparc, solaris2.8
> >>status
> >>major    1
> >>minor    9.0
> >>year     2004
> >>month    04
> >>day      12
> >>language R
> >>
> >>If it matters, I'm using tcsh (in /bin/tcsh).
> >>
> >>-roger
> >>
> >>
> >
> 
> -- 
> Roger D. Peng
> http://www.biostat.jhsph.edu/~rpeng/
> 
> ______________________________________________
> R-devel at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-devel
> 

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907



More information about the R-devel mailing list