[Rd] R CMD check does not recognize S4 functions inside other functions?

Sylvain Loiseau sloiseau at ens-lsh.fr
Fri Aug 28 09:10:03 CEST 2009


It looks as if it is very related to the message I posted just some day  
ago ("Problem with standard generic methods in Matrix package").

Sylvain

On Fri, 28 Aug 2009 03:12:48 +0200, Giles Hooker <gjh27 at cornell.edu> wrote:

> I am developing a new R package and am now checking it for submission to
> CRAN.
>
> The some functions in the package make use of the sparse matrix routines
> in the package 'Matrix'.
>
> When these are loaded in R, they create no problems.
>
> However, when running R CMD check, I run into the following error in  
> executing the examples in a .rd file:
>
>  >   DD = Matrix(diag(1,200),sparse=TRUE)
>  >   tDD = t(DD)
>  >
>  > fres = FitMatchOpt(coefs=coefs,which=2,pars=pars,proc)
> Error in t.default(DD) : argument is not a matrix
> Calls: FitMatchOpt -> t -> t.default
> Execution halted
>
> The first two lines of the function FitMatchOpt are
>
>    DD = Matrix(diag(1,200),sparse=TRUE)
>    tDD = t(DD)
>
> These were fine when given in the examples section of the .rd file  
> directly. However, when defined within a function in the package, the  
> lines cause an error.
>
> Sparse matrices improve the computational efficiency of the routines I  
> am developing and I would like to use them. But I'm not sure how I can  
> get around this error.
>
> Many thanks,
>
> Giles Hooker
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



More information about the R-devel mailing list