Why do I get an error message pointing to Inf values when trying to plot counts over time in R?

后端 未结 2 595
青春惊慌失措
青春惊慌失措 2021-01-25 23:54

I am using the code given in this answer to generate this plot

library(rvest)

cachedir <- \"cache\"
if (!dir.exists(cachedir)) dir.create(cachedir)

URL <         


        
2条回答
  •  再見小時候
    2021-01-25 23:59

    With this line, you are calling the base R plot

    plot("Confirmed", "Last_update", Atlantic, xaxt='n')
    

    And plot a character versus another character, which is not going to work. So most likely you need something like this:

    with(as.data.frame(Atlantic),plot(Last_Update,Confirmed,xaxt="n"))
    axis.POSIXct(1,at=Atlantic$Last_Update,
    labels=format(Atlantic$Last_Update,"%y-%m-%d"),las=2)
    

提交回复
热议问题