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

Don't now need to run load(all) #62

Open
aidanmews opened this issue Nov 26, 2024 · 4 comments
Open

Don't now need to run load(all) #62

aidanmews opened this issue Nov 26, 2024 · 4 comments

Comments

@aidanmews
Copy link
Contributor

aidanmews commented Nov 26, 2024

"10.3 Run devtools::load_all() followed by ?assemble_crime_data to view the help file generated from the roxygen comments"

"11.5 Save the test file and run devtools::load_all()."

@aidanmews aidanmews changed the title Don't now need to run load(all) to view help file Don't now need to run load(all) Nov 26, 2024
@pbbgss
Copy link
Contributor

pbbgss commented Nov 26, 2024

@aidanmews I think I may be misunderstanding this issue? If you have a loaded package and make changes to the package components they changes are not inherited by the loaded package

The function devtools::load_all() must be called in 10.3 to load a version of the package with the help file created in 10.2. Otherwise ?assenble_crime_data won't work.

Similarly we need the devtools::load_all() in 11.5 to load a version of the package with the test files created in 11.4 so that we can use them in 11.6.

@aidanmews
Copy link
Contributor Author

aidanmews commented Nov 26, 2024

I raised the issue because when running through the training I didn't need to use devtools::load_all() for the ?assemble_crime_data to work. Maybe there's been a change so it's no longer needed?

@pbbgss
Copy link
Contributor

pbbgss commented Nov 26, 2024

Yea looks like I was wrong about the behaviour - apologies.

It seems that devtools::document() runs devtools::load_all() making the help file available to ?. If you restart R you would then need to run devtools::load_all() before accessing the help.

# Access to help available after running devtools::document()`

> devtools::document()
ℹ Updating psmi documentationLoading psmi
Writing NAMESPACE
Writing foo.Rd
> ?fooRendering development documentation for "foo"

# Access lost after restarting R

Restarting R session...

> ?foo
No documentation forfooin specified packages and libraries:
you could try ‘??foo# Running devtools::document() gives access to help and loads package

> devtools::document()
ℹ Updating psmi documentationLoading psmi
> ?fooRendering development documentation for "foo"
> foo()
[1] "foo"
> 

I think it is worth leaving in the devtools::load_all() step as it gets people in the habit of running it after making changes to the package without them needing to remember what the exceptions are?

@aidanmews
Copy link
Contributor Author

aidanmews commented Nov 27, 2024

Maybe add a conditional i.e.

"10.3 To view the help file generated from the roxygen comments run ?assemble_crime_data [Note: you may need to first run devtools::load_all()]"

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