Skip to content

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

@selinaZitrone

Description

@selinaZitrone

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions