This is the code (which used to work):
require('RCurl')
require(repr)
require(RCurl)
require(foreign)
require(tidyverse)
states = read.csv("https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-states.csv", sep =",",header = TRUE)
states <- states %>%
mutate(date = as.POSIXct(date, format = '%Y-%m-%d'))
last_day <- states[states$date==states$date[nrow(states)],]
with(last_day, plot(state, cases, las=2, cex.axis=.9, cex.main=1.5,
main="Confirmed cases by state",
xlab="", ylab=""))
... and this is the error message:
Error in plot.window(...) : need finite 'xlim' values In addition: Warning messages: 1: In xy.coords(x, y, xlabel, ylabel, log) : NAs introduced by coercion 2: In min(x) : no non-missing arguments to min; returning Inf 3: In max(x) : no non-missing arguments to max; returning -Inf
But there is no call for logarithmic plotting; and there are no infinite values:
> summary(last_day$cases)
Min. 1st Qu. Median Mean 3rd Qu. Max.
70 23562 86525 134731 154429 831494
barplot
? i.e.barplot(with(last_day, tapply(cases, state, FUN = sum)))
– akrun