r-lib / devtools

Tools to make an R developer's life easier
https://devtools.r-lib.org
Other
2.37k stars 755 forks source link

Using system.file in a tryCatch environment #2548

Closed john-harrold closed 3 weeks ago

john-harrold commented 7 months ago

I am experiencing an issue similar to this one: https://github.com/r-lib/devtools/issues/179

I am developing a package using devetools::load_all() to test things. I am using eval within a tryCatch environment. Part of the code I am evaluating is calling system file for the package I'm developing. If I try to evaluate the code in the tryCatch environment , the system.file command returns "". If I just eval the code eval(parse(text='system.file(package="bob", "path", "to", "bob")')) it will return the file path.

jennybc commented 7 months ago

Can you link to your package and make this conversation much more specific, i.e. I could experience the problem myself?

hadley commented 3 weeks ago

I've closed this issue due to lack of requested reprex. If you still care about this bug, please open a new issue with a reprex.