psteinb / covid19-curve-your-city

Extrapolation der COVID19 Fallzahlen
BSD 3-Clause "New" or "Revised" License
9 stars 5 forks source link

Problem running script #23

Closed gerbsen closed 4 years ago

gerbsen commented 4 years ago

If I run https://github.com/psteinb/covid19-curve-your-city/pull/22 (new data included) with the following command:

Rscript exponential.R -i data/SMS/de_sachsen_sms.csv --deLabel Sachsen --enLabel "Saxony, Germany"

I get this error. Tried this with older branch too, and got same result. :/

34  33 3681.00980    3681.00376 5417.64846 2416.10308 2020-04-04
35  34 4186.31319    4186.30526 6202.68133 2729.33440 2020-04-05
36  35 4760.98112    4760.97087 7101.46773 3083.17403 2020-04-06
[1] "tomorrow"
  day diagnosed diagnosed_sir      upr      lwr       date
1  28  1934.832      1934.831 2754.023 1313.436 2020-03-30
[1] "1 week from now"
[1] day           diagnosed     diagnosed_sir upr           lwr
[6] date
<0 Zeilen> (oder row.names mit Länge 0)
Warnmeldung:
Ignoring unknown parameters: linewidth
[1] "plotting linear and log scale"
Fehler: Aesthetics must be either length 1 or the same as the data (1): x and y
Backtrace:
     █
  1. └─cowplot::plot_grid(...)
  2.   └─cowplot::align_plots(...)
  3.     └─base::lapply(...)
  4.       └─cowplot:::FUN(X[[i]], ...)
  5.         ├─cowplot::as_gtable(x)
  6.         └─cowplot:::as_gtable.default(x)
  7.           ├─cowplot::as_grob(plot)
  8.           └─cowplot:::as_grob.ggplot(plot)
  9.             └─ggplot2::ggplotGrob(plot)
 10.               ├─ggplot2::ggplot_gtable(ggplot_build(x))
 11.               ├─ggplot2::ggplot_build(x)
 12.               └─ggplot2:::ggplot_build.ggplot(x)
 13.                 └─ggplot2:::by_layer(function(l, d) l$compute_aesthetics(d, plot))
 14.                   └─ggplot2:::f(l = layers[[i]], d = data[[i]])
 15.
Ausführung angehalten
psteinb commented 4 years ago

I’ll have a look. Thanks for reporting.

psteinb commented 4 years ago

Ok, the data for Saxony contains a minor detail, that my code doesn't take into account (yet).

city,date,tod_hhmm,diagnosed
Sachsen,2020-03-02,12:00,1
Sachsen,2020-03-06,12:00,2

There is a 4 day difference with no content. I'll try to fix that in my code by filling in the value from day 0 (2020-03-02) into the subsequent rows until the next day with valid entries (2020-03-06).