[R] how to install a locally built package

Bond, Stephen Stephen.Bond at cibc.com
Thu Sep 15 20:38:27 CEST 2011


I got it working by typing a string in getdfv.Rd after \title{

\title{ getdf
%%  ~~function to do ... ~~
}

Strange why the skeleton would not do that given it did 
\name{getdfv}
\alias{getdfv}

Anyway, I'm happy now.

Stephen Bond 

-----Original Message-----
From: Uwe Ligges [mailto:ligges at statistik.tu-dortmund.de] 
Sent: Thursday, September 15, 2011 12:15 PM
To: Bond, Stephen
Cc: r-help at r-project.org
Subject: Re: [R] how to install a locally built package



On 15.09.2011 17:47, Bond, Stephen wrote:
> Uwe,
>
> That gave me the same error like CMD install
>> install.packages("C:/Temp/mypack_1.0.tar.gz", repos=NULL, type="source")
>
> install.packages("C:/Temp/mypack_1.0.tar.gz", repos=NULL, type="source")
> Loading required package: stats
> Loading required package: utils
> Loading required package: graphics
> Loading required package: splines
> * installing *source* package 'mypack' ...
> ** R
> ** preparing package for lazy loading
> ** help
> Warning: C:/DOCUME~1/BondStep/LOCALS~1/Temp/Rtmpw5N7dm/R.INSTALL6ccc14e6/mypack/man/mypack-package.Rd:33: All text must be in a section
> *** installing help indices
> Error in Rd_info(db[[i]]) : Rd files must have a non-empty \title.
> See chapter 'Writing R documentation' in manual 'Writing R Extensions'.
> * removing 'c:/PROGRA~1/R/R-212~1.1/library/mypack'
> * restoring previous 'c:/PROGRA~1/R/R-212~1.1/library/mypack'
> Warning message:
> In install.packages("C:/Temp/mypack_1.0.tar.gz", repos = NULL, type = "source") :
>    installation of package 'C:/Temp/mypack_1.0.tar.gz' had non-zero exit status
>
> is there a way to skip the Rd part? This is for private use only and there is no help or data files.


Then you have to delete the Rd file that has been generated by 
package.skeleton.
Please read the manuals "Writing R Extensions" and "R Installation and 
Administration".

Best,
Uwe Ligges



> Thank you.
>
> Stephen Bond
>
> -----Original Message-----
> From: Uwe Ligges [mailto:ligges at statistik.tu-dortmund.de]
> Sent: Thursday, September 15, 2011 11:43 AM
> To: Bond, Stephen
> Cc: r-help at r-project.org
> Subject: Re: [R] how to install a locally built package
>
>
>
> On 15.09.2011 17:32, Bond, Stephen wrote:
>> Hello useRs,
>>
>> I am trying to put my funcs in a package to avoid clutter in my workspace as the funcs are now in .Rprofile.
>> All plain R code no compilations. Using win XP with a full cygwin install and R2.12
>> I first did
>>
>> package.skeleton("mypack",list="getdfv", namespace=T) # just a single func
>>
>> which created a folder with the required stuff in it.
>> Calling R CMD build creates a tar.gz file with warnings about DOS paths.
>>
>> Trying to install from the R GUI complains
>>> install.packages("mypack",repos="C:/Temp/mypack_1.0.tar.gz")
>> Warning: unable to access index for repository C:/Temp/mypack_1.0.tar.gz/bin/windows/contrib/2.12
>> Warning message:
>> In getDependencies(pkgs, dependencies, available, lib) :
>>     package 'mypack' is not available
>
>
> install.packages("C:/Temp/mypack_1.0.tar.gz", repos=NULL, type="source")
>
> seems to be what you want.
>
> Uwe Ligges
>
>
>> putting the mypack folder in zip and then trying to install from the zip produces no error message but then
>>
>>> library("mypack")
>> Error in library("mypack") : 'mypack' is not a valid installed package
>>
>> Just putting the folder in the library folder of R did not work either
>>
>> Finally
>> R CMD Install complains about missing title in the Rd file. I do not have a Rd file as the skeleton did not create it.
>>
>> Please, advise how to make simple R code available to be called without showing in ls()
>>
>> Thank you.
>> Stephen Bond
>>
>>
>> 	[[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