reconhub / incidence

☣:chart_with_upwards_trend::chart_with_downwards_trend:☣ Compute and visualise incidence
https://reconhub.github.io/incidence
Other
58 stars 13 forks source link

Submit to CRAN #62

Closed zkamvar closed 6 years ago

zkamvar commented 6 years ago

This is a tracking issue for CRAN submission.

epitrix errors:

This appears to be a problem that can easily be fixed by updating the documentation.

> ## Ebola estimates of the SI distribution from the first 9 months of                                                                                                                  
> ## West-African Ebola oubtreak                                                                                                                                                        
>                                                                                                                                                                                       
> mu <- 15.3 # days                                                                                                                                                                     
> sigma <- 9.3 # days                                                                                                                                                                   
> param <- gamma_mucv2shapescale(mu, sigma / mu)                                                                                                                                        
>                                                                                                                                                                                       
> if (require(distcrete)) {                                                                                                                                                             
+   w <- distcrete("gamma", interval = 1,                                                                                                                                               
+                  shape = param$shape,                                                                                                                                                 
+                  scale = param$scale, w = 0)                                                                                                                                          
+                                                                                                                                                                                       
+   r2R0(c(-1, -0.001, 0, 0.001, 1), w)                                                                                                                                                 
+                                                                                                                                                                                       
+                                                                                                                                                                                       
+ ## Use simulated Ebola outbreak and 'incidence' to get a log-linear                                                                                                                   
+ ## model of daily incidence.                                                                                                                                                          
+                                                                                                                                                                                       
+   if (require(outbreaks) && require(incidence)) {                                                                                                                                     
+     i <- incidence(ebola_sim$linelist$date_of_onset)                                                                                                                                  
+     plot(i)                                                                                                                                                                           
+     f <- fit(i[1:100])                                                                                                                                                                
+     f                                                                                                                                                                                 
+     plot(i[1:150], fit = f)                                                                                                                                                           
+                                                                                                                                                                                       
+     R0 <- lm2R0_sample(f$lm, w) <======== FIX ME!!!!                                                                                                                                          
+     hist(R0, col = "grey", border = "white", main = "Distribution of R0")                                                                                                             
+     summary(R0)                                                                                                                                                                       
+   }                                                                                                                                                                                   
+ }               
Warning in fit(i[1:100]) :                                                                                                                                                              
  22 dates with incidence of 0 ignored for fitting                                                                                                                                      
Error: $ operator is invalid for atomic vectors                                                                                                                                         
Execution halted                     

Projections errors

This appears to be a problem with the get_dates() method in incidence over-writing the get_dates() method from projections when incidence is loaded afterwards and is F R U S T R A T I N G

zkamvar commented 6 years ago

I've addressed the projections error in https://github.com/reconhub/projections/pull/8 and the epitrix error in https://github.com/reconhub/epitrix/pull/5