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..

Javi_VM
  • 505
  • 2
  • 10
  • 4
    No error for me on `ggplot2_2.2.1.9000`, `chron_2.3-52` and R 3.4.0. Can you add your `chron` version? – Maurits Evers May 08 '18 at 09:25
  • I updated my question with more information... – Javi_VM May 15 '18 at 07:52
  • updating to `chron_2.3-52` solved my issue. For some reason it was stucked to `chron_2.3-45` and "update" function in Rstudio (in Packages pane) did not detect the available update of `chron`. – Javi_VM May 15 '18 at 08:28

1 Answers1

0

The problem is solved now. Updating chron to chron_2.3-52 solved everything.

Javi_VM
  • 505
  • 2
  • 10