From ligges at statistik.tu-dortmund.de  Sat Apr  5 21:27:44 2008
From: ligges at statistik.tu-dortmund.de (Uwe Ligges)
Date: Sat, 05 Apr 2008 21:27:44 +0200
Subject: [Rd] package.skeleton.S4
In-Reply-To: <47F79677.9070101@u-paris10.fr>
References: <47EF9A63.3070609@u-paris10.fr>	<47F1198C.7070407@r-project.org>	<47F758B1.4010503@u-paris10.fr>	<18423.29163.115366.839889@cmath-5.math.ethz.ch>	<47F774A1.4050901@u-paris10.fr>	<47F77745.8000301@statistik.tu-dortmund.de>
	<47F77A9C.3010206@u-paris10.fr> <47F792B7.8010404@stats.uwo.ca>
	<47F79677.9070101@u-paris10.fr>
Message-ID: <47F7D2B0.3030408@statistik.tu-dortmund.de>



Christophe Genolini wrote:
> Am I suppose to repport only but, or can I also make some comments?
> Well, I guess if I am not suppose to comment, it is easy to ignore them...
> 
> Concerning the help file, some other examples might be a good complement 
> to the existing one.
> 
> --- 8< ------------------
> \examples{
> require(stats)
> ## two functions and two "data sets" :
> f <- function(x,y) x+y
> g <- function(x,y) x-y
> d <- data.frame(a=1, b=2)
> e <- rnorm(1000)
> 
> # using list will create one file for each function
> package.skeleton(name="mypkg",list=c("f","g","d","e"))
> 
> 
> ### Using a file :
> sink("myPack2.r")
> cat("
>    f2 <- function(x,y) x*y
>    d2 <- data.frame(a=rnorm(10),b=1:10)
> ")
> sink()
> 
> # using code_files will copy the file
> package.skeleton(name="mypkg2",code_files="myPack2.r")
> 
> ### Dealing with S4 :
> sink("myPack3.r")
> cat("
>    setClass('A',representation(x='numeric'))
>    
> setMethod('print','A',function(x){cat('AAA',x at x,'AAA');return(invisible())}) 
> 
> ")
> sink()
> package.skeleton(name="mypkg3",code_files="myPack3.r")
> 
> ### function or variable starting with . (dot) are hidden (see NAMESPACE)
> .h <- function(x,y) x/y
> package.skeleton(name="mypkg4",list=c("f","g","d","e",".h"))
> }
> --- 8< ------------------
> 
> 
> Concerning the package construction:
> after running package.skeleton, we (low level user) migth expect R CMD 
> check and R CMD build to compile
> It is not the case because of an error and some warnings.

Then you are wrong in your expectation.

We (other low level users) might expect that R CMD check warns or better 
fails when a documentation file has not been edited so that it contains 
sensible information. It is alreeady constrructed for you. So just edit 
it and replace the parts by relevant information that R cannot fill in 
for you. Please read the manuals and the readme file provided....



> Here is the error :
>    Examples failed
> 
> May be some '#' can be put in the example code to prevent it from failling?
> 
> The warnings are :
>    ~kwd1 is not a keyword
>    duplicated alias for myMethod,AA-method
>    missing link()
>    Unaccounted top-level text
> 
>    for french people, some "?" and "?" provoque warnings as well.

Then you have to declare an encoding as the manual "Writing R 
Extensions" suggests.

Uwe Ligges


> 
> Christophe



[Rd] package.skeleton.S4
Uwe Ligges