timchurches / blog

Personal blog
40 stars 49 forks source link

Issue with March 18, 2020 blog post (covid part 2) #18

Open zterner-mitre opened 8 months ago

zterner-mitre commented 8 months ago

Hi,

I am trying to run the code from here: https://timchurches.github.io/blog/posts/2020-03-18-modelling-the-effects-of-public-health-interventions-on-covid-19-transmission-part-2/

When I copy and paste the code, (or when I download the .Rmd file and run it), I encounter two issues:

1) get_prev.icm is not defined in your code. (This is fixable by finding it on your Github and copying it from there into my R session.)

2) The main simulate function does not work and it gives a mysterious error.

Although prog.rand is defined when you define simulate, it claims that it does not exist.

image

It throws an error inside an anonymous function within the EpiModel package, so I cannot correct it since RStudio says that file is read-only. I have also tried defining this variable globally but that deos not work.

Do you have any thoughts on how to fix this? Unfortunately, if simulate does not run, then the whole tutorial (which looks nice otherwise) is not able to be followed.