[Roxygen-devel] roxygen and subclassing? - Error in cdr(preorder.flatten.expression(expression))

Bastian A. bastianra at gmail.com
Fri Nov 13 22:00:05 CET 2009


Hi,

I've run into the same issue, but the example does not solve it, as
the class definition is self referential, which will cause R to throw
an error.
Could you give working examples of the two cases where either the
contains or representation are empty e.g.:

setClass(Class="Object",representation=representation("referenceContainer"="environment"))
[no superclass]
setClass(Class="RDataFileList",contains="list") [only the superclass]

Thanks for any hints,
Bastian

I am using R-2.10.0 with roxygen 0.1-2:
[snip]
Packaged:           2009-11-12 08:32:10 UTC; meugster
Repository:         CRAN
Date/Publication:   2009-11-12 11:39:59
Built:              R 2.10.0; x86_64-unknown-linux-gnu; 2009-11-13
                    19:28:50 UTC; unix


On Sun, Aug 23, 2009 at 2:39 AM, Manuel J. A. Eugster
<Manuel.Eugster at stat.uni-muenchen.de> wrote:
> Hi Mark,
>
> in case of S4 you have to specify the classes, methods, etc in
> "full style", e.g.,
>
> setClass("BClass",
>   contains=c("BClass"),
>   representation=representation(
>     s1="character",
>     s2="numeric"))
>
> That's because the Roxygen parser is very rudimentary in case of
> S4.
>
>
> Best,
>
> Manuel.
>
>
>
> Mark Herzog wrote:
>> Hello –
>>
>>
>>
>> I am working with the devel source code (S4 support) and receiving the
>> following error (includes roxygen call, in case that helps):
>>
>>
>>
>>>  roxygenize(package.dir=paste(work.dir,"/release/",sep=""),
>>
>> + roxygen.dir=paste(work.dir,"/release/pkg.roxygen",sep=""),
>>
>> + copy.package=FALSE,
>>
>> + unlink.target=FALSE,
>>
>> + use.Rd2=TRUE
>>
>> + )
>>
>> Error in cdr(preorder.flatten.expression(expression)) :
>>
>>   CDRing a null list
>>
>>
>>
>> After doing some  investigation, I believe it is related to subclassing,
>> (e.g. using ‘contains’ argument within a setClass statement).
>>
>> Is this something that is not supported yet within roxygen, or am I
>> doing something incorrectly? Is there a workaround?
>>
>> I tried adding #’ @nord to the line before the setClass statement, but
>> that didn’t seem to help.
>>
>>
>>
>>>  Sys.info()
>>
>>                      sysname                      release
>>
>>                    "Windows"                         "XP"
>>
>>                      version
>>
>> "build 2600, Service Pack 3"
>>
>>                      machine
>>
>>                        "x86"
>>
>>>
>>
>>
>>
>> Thanks for any insight,
>>
>> Mark
>>
>>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>> Mark Herzog, Ph.D.
>> Informatics Division Director
>>
>> Quantitative and Computational Sciences
>> PRBO Conservation Science
>> 3820 Cypress Drive #11
>> Petaluma, CA 94954
>> 707-781-2555 x308 (office)
>> 707-765-1685      (fax)
>>
>> 707-992-5726 (google voice)
>>
>> mpherzog (skype)
>>
>>
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Roxygen-devel mailing list
>> Roxygen-devel at lists.r-forge.r-project.org
>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/roxygen-devel
> _______________________________________________
> Roxygen-devel mailing list
> Roxygen-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/roxygen-devel
>


More information about the Roxygen-devel mailing list