Submit your own R package - @examples

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Submit your own R package - @examples

schwart
Dear community,

I am trying to submit my first R package to CRAN and stumbled upon the
following problem:

Most of my methods, are not exported to the namespace using the @examples
options.

Will I have to provide @examples for these methods in the documentation? If
yes, I have the problem that when I run the @examples for the method that is
not exported, I receive the error

Error in foo() : could not find function "foo"

Execution halted

 

What am I missing? Will I even have to provide examples to pass the CRAN
tests?

 

Thank you in advance for your help,

schwart

 


        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: Submit your own R package - @examples

S Ellison-2
> Most of my methods, are not exported to the namespace using the
> @examples
> options.

Joanna,
You normally need to export _all_ the objects/functions that you expect users to be able to run.
And if you are giving an example of a function, it seems likely that you expect users to use it, so it needs to be exported.

But it looks like you're using Roxygen and if I'm reading the documentation correctly, @examples doesn't export anything at all. @export does that. See https://cran.r-project.org/web/packages/roxygen2/vignettes/namespace.html

This is also a development question: maybe try the R-package-devel or R-devel lists?

Steve Ellison




*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: Submit your own R package - @examples

Bert Gunter-2
In reply to this post by schwart
This should be posted on the r-package-devel list rather than here:

https://stat.ethz.ch/mailman/listinfo/r-package-devel

Cheers,
Bert

Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

On Wed, Aug 8, 2018 at 12:08 AM, Johanna Schwarz <[hidden email]>
wrote:

> Dear community,
>
> I am trying to submit my first R package to CRAN and stumbled upon the
> following problem:
>
> Most of my methods, are not exported to the namespace using the @examples
> options.
>
> Will I have to provide @examples for these methods in the documentation? If
> yes, I have the problem that when I run the @examples for the method that
> is
> not exported, I receive the error
>
> Error in foo() : could not find function "foo"
>
> Execution halted
>
>
>
> What am I missing? Will I even have to provide examples to pass the CRAN
> tests?
>
>
>
> Thank you in advance for your help,
>
> schwart
>
>
>
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.