[R] installing a package in linux

Ruihong Huang ruihong.business at googlemail.com
Wed May 5 08:53:29 CEST 2010


On 05/05/2010 02:44 AM, Tengfei Yin wrote:
> Hi
>
> R basic packages always works fine in my laptop (also ubuntu), you don't
> need to reinstall anything once you installed the package, did you do that
> in your terminal like
> $R (enter R session)
>    
>> install.packages('package name')
>> q()
>>      
> then everytime you enter the R session, you just library('package name'),
> that should work... I don't know if it is sth about user privilege , do you
> use R on your own computer or on other servers?
>
> Regards
>
> Tengfei
>
>
> On Tue, May 4, 2010 at 2:25 PM, Fahim Md<fahim.md at gmail.com>  wrote:
>
>    
>> I recently started using ubuntu 9.10 and I am using gedit editor and R
>> plugin for writing R code. To install any package I need to do:
>> $ install.packages()
>>   //window pop-up for mirror selection
>> //then another window pop up for package selection.
>> After this as long as I am not exiting, the function of the newly installed
>> packages are available.
>>
>> After I exit (i use to put 'no' in 'save workspace' option) from R,  if I
>> want to again work in R, I have to repeat the process of package install.
>> This reintallation problem was not there in windows(I was using Tinn-R as
>> editor, I just need to put require('package-name') to use its function).
>>
>>      
There is nothing to do with the editor. I guess, you should run "sudo R" 
(you shouldn't use this to run a normal R session) in Ubuntu, which will 
give you the right to write into the R directory typically in /usr/lib.  
And then using "install.packages('package.name')" inside this R 
session.  To load a library at beginning of each R session, you might 
consider the .First  function like,

.First <- function(){
   library('package.name')
   invisible()
}

and then quite R session with work space saved.

Best,

Ruihong
>> Is there anyway so that reinstallation of the package is avoided???
>> thanks
>> --Fahim
>>
>>         [[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.
>>
>>      
>
>
>



More information about the R-help mailing list