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

Following example in chapter 7 not possible: source file monopoly.R not found #315

Open
selinaZitrone opened this issue Sep 29, 2023 · 1 comment
Assignees

Comments

@selinaZitrone
Copy link

First of all: Really great and helpful book. Thanks a lot for writing and sharing!

Summary of the issue

I Could not run the monopoly simulation example for code profiling in chapter 7 with the code given in the book.
The problem is that the profile is produced but the source file monopoly.R is not available, so Figure 7.2 could not be reproduced.
I solved the issue by cloning and building the package locally, but probably there is a better solution?

Details of what I tried

First, I installed the package from source like described in the text:

devtools::install_github("csgillespie/efficient",
                         args = "--with-keep.source")

This installed the package but got me a warning:

grafik

When I did the profiling as suggested in the book, it works but the source file monopoly.R is not available. So I get the profile but I cannot reproduce the screenshot Figure 7.2 showing the profile per line of code.

I thought this might have something to do with the warning I got, so instead I tried:

remotes::install_github("csgillespie/efficient",
                         args = "--with-keep.source")

This installed the package without the warning message but the problem was still that the profile did not show the source file monopoly.R

What I tried next:

  • Clone the repo for the efficient package
  • Build it locally
  • Do the profiling on the locally built package version

This worked and the profile shows me the actual source code of monopoly.R like shown in Figure 7.2

Not sure if I missed anything or if this is a problem that others also ran into.

@selinaZitrone selinaZitrone changed the title Following example in chapter 7 not possible: source file for simulate_monopoly not available Following example in chapter 7 not possible: source file monopoly.R not found Sep 29, 2023
@Robinlovelace
Copy link
Collaborator

Thanks @selinaZitrone. Any ideas @csgillespie ?

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

3 participants