Re: [Rd] DESCRIPTION file and Rd examples

From: Simon Urbanek <simon.urbanek_at_r-project.org>
Date: Fri, 15 Apr 2011 14:18:24 -0400

On Apr 14, 2011, at 11:00 PM, Dario Strbenac wrote:

> I have a confusing error from R CMD check that I don't get when running the example manually by hand.
>
> In the \examples section of an Rd file, I create a GRanges object, then I call a function with the GRanges object, whose first 2 lines are
>
> require(GenomicRanges)

require() is doesn't guarantee that the package will load, so I think what you meant to write was more

if (require(GenomicRanges, quietly=TRUE)) {  ...

> annoDF <- as.data.frame(anno) # anno is the GRanges object.
>
> and that second line gives:
>
> Error in as.data.frame.default(anno) :
> cannot coerce class 'structure("GRanges", package = "GenomicRanges")' into a data.frame
> Calls: annoGR2DF ... annoGR2DF -> .local -> as.data.frame -> as.data.frame.default
>
> I have GenomicRanges listed in my Imports: field, and IRanges in the Suggests: of the DESCRIPTION file (it's require()d elsewhere). I'm trying to avoid putting packages in Depends: , so my package loads fast. Any tips of what I'm not understanding properly ?
>
> Thanks.
>
> --------------------------------------
> Dario Strbenac
> Research Assistant
> Cancer Epigenetics
> Garvan Institute of Medical Research
> Darlinghurst NSW 2010
> Australia
>
> ______________________________________________
> R-devel_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri 15 Apr 2011 - 18:23:52 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 18 Apr 2011 - 17:30:50 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive