Closed agandy closed 4 years ago
@jonathanishhorowicz - could you look at this at your leisure?
Will have a look now
I have fixed the case you have posted here, but the reverse case
plot_obs(fit, type="deaths", dates=c(NA, as.Date("2020-03-21")))
ie when dates
is c(NA, a date object)
is a little more tricky. Having NA
as the first element makes the whole dates
vector become numeric and converting this back to a date means specifying the date origin.
To me it seems easier and less buggy to ask the user to to as.Date
on the whole of dates
rather than a single element.
Thanks. Happy with any solution, as long as there is a meaningful error message. A
From: Jonathan Ish-Horowicz notifications@github.com Sent: 15 July 2020 12:23 To: ImperialCollegeLondon/epidemia epidemia@noreply.github.com Cc: Gandy, Axel a.gandy@imperial.ac.uk; Author author@noreply.github.com Subject: Re: [ImperialCollegeLondon/epidemia] plot_obs date range does not accept Date object and NA (#37)
This email from notifications@github.commailto:notifications@github.com originates from outside Imperial. Do not click on links and attachments unless you recognise the sender. If you trust the sender, add them to your safe senders listhttps://spam.ic.ac.uk/SpamConsole/Senders.aspx to disable email stamping for this address.
I have fixed the case you have posted here, but the reverse case
plot_obs(fit, type="deaths", dates=c(NA, as.Date("2020-03-21")))
ie when dates is c(NA, a date object) is a little more tricky. Having NA as the first element makes the whole vector become numeric and converting this back to a date means specifying the date origin.
To me it seems easier and less buggy to ask the user to to as.Date on the whole of dates rather than a single element.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ImperialCollegeLondon/epidemia/issues/37#issuecomment-658711845, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AA7JUZW2QSWW4DRJBAJ5OBDR3WGR3ANCNFSM4O2K7P3Q.
from the examples of plot_obs