Skip to content

[R-pkg-devel] how to provide an example for my package when I want to generate a figure

2 messages · csmatyi, Berry Boessenkool

#
Hello all,

I have a fairly simple package I want to make. It takes two dataframes and then creates a jpeg (a heat map) based on the info in the dataframes.

I know how to put the code in the vignette.
But as to how to make an example, I don't know that. Would I put the code in the R code for the heat map?

How can I do this, it seems very foggy to me.

Thanks, Matthew

Sent with [ProtonMail](https://protonmail.com) Secure Email.
Message-ID: <SHAs3o5nTohyDmKI-DFJa75V6RTV4Pl_DPEvsiw4ozaxdg84rQmlqu-9BMU3A25WWThOREE7GHFDrGxIcmq-1Mo1xeGFVTKe4btcwikAUxI=@protonmail.com>
#
Hi Matthew,

see the notes on examples in function documentations here:
https://r-pkgs.org/man.html#man-functions
if you use the Roxygen setup (which I recommend)
or the corresponding info in WRE:
https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Writing-R-documentation-files

Regards,
Berry