2

If I run the example in ?scale_x_chron:

if(require("ggplot2")) {
dd <- data.frame(tt = chron(1:10), value = 101:110)
p <- ggplot(dd, aes(tt, value)) +
         geom_point() + scale_x_chron(format = "%m-%d")
print(p)
}

I get

Error in as.POSIXct.default(x) : 
do not know how to convert 'x' to class “POSIXct” 

Is the function broken? Should I install another version? I tried to update via rstudio update button (in packages) but no luck.

EDIT: chron version is chron_2.3-45

EDIT2: I have noticed that

as.Date(chronDate)
Error in as.Date.default(chronDate) : 
do not know how to convert 'chronDate' to class “Date”

It used to work back in R 3.4... I am having trouble to go back to previous versions of R, so this is really a problem for me..

4

1 回答 1

0

现在问题已经解决了。更新 chron 以chron_2.3-52解决所有问题。

于 2018-05-15T08:30:24.930 回答