system.file has disappeard.

19 views
Skip to first unread message

Luca Cerone

unread,
Mar 16, 2015, 10:16:09 AM3/16/15
to rdev...@googlegroups.com
Hi everybody,

devtools::system.file has disappeared from the latest version of devtools available in CRAN.

I figured that it is now called shim_system.file. Is this going to be a permanent change? And why is shim_system.file not exported when devtools is loaded?

Thanks a lot in advance for the help,

Cheers,
Luca

Hadley Wickham

unread,
Mar 16, 2015, 10:20:11 AM3/16/15
to Luca Cerone, rdev...@googlegroups.com
Devtool's system.file() shim is automatically added to the correct
environment when you do load_all(). Have you been having specific
problems?

Hadley
> --
> You received this message because you are subscribed to the Google Groups
> "devtools" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rdevtools+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
http://had.co.nz/

Luca Cerone

unread,
Mar 16, 2015, 11:06:06 AM3/16/15
to rdev...@googlegroups.com, luca....@gmail.com
Hi Hadley,
actually since I upgraded to v.1.7 from CRAN (the one on github says the build is failing),
I am only able to use system.file using devtools:::shim_system.file.

Even after attacching devtools with library(devtools), system.file calls the base version, not the devtools one.

Luca Cerone

unread,
Mar 16, 2015, 11:07:35 AM3/16/15
to rdev...@googlegroups.com, luca....@gmail.com
Sorry I pressed the send button before finishing the mail

devtools::system.file does not exists anymore and I have to use devtools:::shim_system.file.

Thanks for the help with this,
Best Wishes,

Luca

Hadley Wickham

unread,
Mar 16, 2015, 11:31:31 AM3/16/15
to Luca Cerone, rdev...@googlegroups.com
You have to run load_all() before the shim is applied.
Hadley

Winston Chang

unread,
Mar 16, 2015, 1:18:39 PM3/16/15
to Hadley Wickham, Luca Cerone, rdev...@googlegroups.com
When you run load_all() on your package, the devtools:::shim_system.file function gets inserted into your package's imports environment, with the name system.file. So if any functions in your package call system.file(), they'll see the shimmed version (when your package is loaded with load_all()).

It's not exported because there's not a reason for most users to call that function directly -- the original intended purpose of the function was only to be used as a shim as described above. The fact that devtools::system.file was exported in the past was because we had not yet thought of the current (cleaner) way of adding shims.

-Winston

Luca Cerone

unread,
Mar 16, 2015, 4:36:58 PM3/16/15
to Hadley Wickham, rdev...@googlegroups.com

Of course you are right, I never noticed this before though..

Just out of curiosity, what does shim stands for?

Thanks for the help,

Cheers,

Luca

Gábor Csárdi

unread,
Mar 16, 2015, 4:52:49 PM3/16/15
to Luca Cerone, Hadley Wickham, rdev...@googlegroups.com

Luca Cerone

unread,
Mar 16, 2015, 5:08:55 PM3/16/15
to Gábor Csárdi, Hadley Wickham, rdev...@googlegroups.com
Thanks!
Reply all
Reply to author
Forward
0 new messages