FohmAnalys / SEIR-model-Stockholm

Skattning av peakdag och antal infekterade i covid-19-utbrottet i Stockholms län februari-april 2020.
GNU General Public License v2.0
58 stars 32 forks source link

Object 'S' not found #3

Open dnulnets opened 4 years ago

dnulnets commented 4 years ago

Hi, Thanks for publishing this. I am just trying to get it to run and get the following:

**> Est_par_model <- Estimate_function_Stockholm_only_local(p_symp = p_symp_use, p_lower_inf = p_lower_inf_use)
[1] "Optimisation initialised"
 Error in eval(substitute(expr), data, enclos = parent.frame()) : 
  object 'S' not found** 

It is probably due to a version problem (?) on my side, but are unable to find out the cause. SessionInfo is this:

> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 19.10

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.8.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.8.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=sv_SE.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=sv_SE.UTF-8   
 [6] LC_MESSAGES=en_US.UTF-8    LC_PAPER=sv_SE.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=sv_SE.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] deSolve_1.28       rootSolve_1.8.2    RColorBrewer_1.1-2 openxlsx_4.1.4     reshape2_1.4.3    

loaded via a namespace (and not attached):
[1] compiler_3.6.1 magrittr_1.5   plyr_1.8.6     tools_3.6.1    Rcpp_1.0.4     stringi_1.4.6  stringr_1.4.0  zip_2.0.4     
> 
dnulnets commented 4 years ago

Found it! It was a character conversion problem, I got a replacement character instead of åäö, see below.

region_namn <- unlist(strsplit(r_name, split="s l�n"))
region_namn <- unlist(strsplit(region_namn, split=" l�n"))
region_namn <- region_namn[-which(region_namn == "Riket")]

When I change it to "ä" in my local copy everything worked just fine!

consideRatio commented 4 years ago

Thanks for figuring that out @dnulnets! Running the code from start to end now get stuck at a later time like this during plot generation.

> plot(c(0:150),Basic_repr(c(0:150), delta = Est$par[1], epsilon = Est$par[2],  theta = Est$par[3]  ,gamma = gammaD),type="l", ylab="R0(t)",lwd=2, 
+  .... [TRUNCATED] 
Error in plot.new() : figure margins too large
dnulnets commented 4 years ago

Where do you run the code? In R-studio or on the command line? The plot panel might be too small. I did not have any problem when I ran it directly in the command line. I have not tried with R-studio.