Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add examples to functions #122

Closed
wants to merge 3 commits into from
Closed

Add examples to functions #122

wants to merge 3 commits into from

Conversation

DrMattG
Copy link
Collaborator

@DrMattG DrMattG commented Apr 6, 2023

Added a few examples to functions (linked to #117)

compare.R
dedup.R
runShiny.R

I am not sure if the format of the examples is correct - I have used:
if (interactive()) { }

@DrMattG DrMattG requested review from LukasWallrich and TNRiley April 6, 2023 20:22
@TNRiley
Copy link
Collaborator

TNRiley commented Apr 6, 2023

@LukasWallrich @DrMattG I may need some assistance understanding things here. Would love to get a run through on what happened here. Also on examples in general. I understand why my examples which I removed railed CMD, but have a few questions.

@LukasWallrich
Copy link
Collaborator

I just chatted with @TNRiley about this, and he will add a unique_citations dataframe to the package data that we can then use in all examples (and also for testing). So let's maybe put this on hold until we have that data.

Instead of interactive(), I would wrap examples that should not be run into

\dontrun {

}

That makes the intention clearer, but should be rather rare - maybe we want to use it for the import functions to avoid having to also provide ris files, but everything else should probably have working examples (export functions can easily write tempfiles ...)

@TNRiley
Copy link
Collaborator

TNRiley commented Apr 12, 2023

I've been working on this and made some mistakes, but learning. It looks like interactive() is the recommended way to wrap examples rather than \dontrun - from the HW packages book. I'm still unsure about the best practice of when to include interactive() vs. not, however. Hopefully, I can get these @exmaplesfigured out soon to fix this CMD check.

@DrMattG DrMattG closed this Apr 17, 2023
@DrMattG
Copy link
Collaborator Author

DrMattG commented Apr 17, 2023

Changes made in main.

@DrMattG DrMattG deleted the add_examples branch September 6, 2024 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants