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 dev_example() to documentation for run_examples() #2545

Open
orgadish opened this issue Nov 8, 2023 · 3 comments
Open

Add dev_example() to documentation for run_examples() #2545

orgadish opened this issue Nov 8, 2023 · 3 comments

Comments

@orgadish
Copy link

orgadish commented Nov 8, 2023

Is your feature request related to a problem? Please describe.
When developing my package examples, I often want to test only one file's examples. Using run_examples(start="my_file") is insufficient, since I have little control over what comes after so I have to scroll up to see what I actually want.

It looks like this was implemented at some point (#108), but I can't find it anymore (at least in version 2.4.5).
If there is a way to do this with run_examples(), I recommend highlighting that in the help documentation.

Describe the solution you'd like
A function like run_example() which runs one file's example.

Update 01/21/2024

Such a function exists! It's just in the pkgload package, which is not where I would have expected to look for it, since a) run_examples() is in devtools and b) run_example() doesn't have to do with "simulating the process of installing and loading a package" in my mind.

Given that the function(s) already exist, but are perhaps not easy to find, this request is to do one or both of the following:

  1. Reference dev_example() / run_example() in the docs for devtools::run_examples()
  2. Move dev_example() / run_example() to devtools.
@orgadish
Copy link
Author

orgadish commented Nov 8, 2023

Looks like this exists as pkgload::dev_example(), so the ask is to add this to the run_examples documentation and/or export dev_example() as part of devtools.

@pawelru
Copy link

pawelru commented Jan 19, 2024

I was having a similar issue and I have found out pkgload::run_example(). Does that help?

@orgadish
Copy link
Author

orgadish commented Jan 22, 2024

@pawelru I think the better alternative for me is pkgload::dev_example() which allows you pass in the topic/name rather than the full path.

Since this function already exists, I think the need is just to reference this function in the devtools::run_examples() documentation so that we even know this exists (since most of us use devtools to do most of our package building, rather than dealing with the separate underlying packages. I will update the request title and description accordingly.

@orgadish orgadish changed the title Function/option to run only one example Add dev_example() to documentation for run_examples() Jan 22, 2024
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

No branches or pull requests

2 participants