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

Documentation on how to keep source code references (line numbers) in installed packages seems non-working #66

Open
aryoda opened this issue Jun 9, 2021 · 1 comment

Comments

@aryoda
Copy link
Owner

aryoda commented Jun 9, 2021

To show the file name and line number that has thrown a condition the current documentation at github says:

enable the keep.source.pkgs option before (you install the packages!)

It seems that this does not work, at least not if I use install.packages as-is:

install.packages("data.table")

What seems to work is:

install.packages("data.table", INSTALL_opts = "--with-keep.source")

The reason seems to be that install.packages calls R CMD INSTALL internally.

Adding the option to .Rprofile seems to work keeping the source references (tested with R 3.6.1).

What should work: Setting the environment variable R_KEEP_PKG_SOURCE to yes (see ?options for the option keep.source.pkgs).

See also:

https://stackoverflow.com/a/50268331

https://cran.r-project.org/doc/manuals/R-exts.html#Dynamic-pages

keep.source=TRUE Whether to keep the author’s formatting when displaying the code, or throw it away and use a deparsed version.

https://cran.r-project.org/doc/manuals/R-exts.html#Tidying-R-code

@aryoda
Copy link
Owner Author

aryoda commented Jul 31, 2022

May be done together with #48 and added to the best practices

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant