1
library(ggpmisc)

ggplot(Table, aes(x = Date, y = Value, group = Group)) + 
   geom_line(size = 0.2) +
   scale_y_continuous("Value") +
   scale_x_date("Date", breaks = "4 years", labels = date_format("%Y"), expand = expansion(mult = 0, add = 0)) +
   annotate(geom = 'table', x = xValue, y = yValue, label = list(TitleTable)))

The generalized code above nets me the error message:

Error in f(...) : argument "table.theme" is missing, with no default

As far as I know, having looked through ggpmisc documentation, table.theme isn't an argument annotate even takes.

What's more maddening is this code worked a few days ago and got me the results I desired. re-running it without changing a thing (to my knowledge) now result in this error.

I'm also quite certain the source of the error is due to the annotate function, despite the message not explicitly stating as such, as running the ggplot function without it runs fine and yields the expected results.

  • Thanks for reporting this! Sorry that I did not answer earlier! What version of ggpmisc are you using? The latest version overrides ggplot2's version of annotate to make it possible to use the npc geoms. An oversight in my new code may be causing the error. Please, check if using ggplot2::annotate() in your code solves the problem. I will meanwhile investigate why ggpmisc::annotate() is failing. I will write an answer as soon as I have fixed package 'ggpmisc'. – Pedro J. Aphalo Dec 20 '20 at 15:11
  • I am unable to reproduce this error. Please, provide a reproducible example ("reprex") that includes data, or uses data included in R itself, and that triggers the error. Please, check that all packages are up-to-date, and if this is not possible, please, let me known which versions of 'ggpmisc' and 'ggplot2' you are using. Be aware the xValue in your code must be a Date object given the scale you are using. See if a bad default theme has been activated, reset it with ttheme_set() and then run again your code. – Pedro J. Aphalo Dec 20 '20 at 15:46
  • Apologies Pedro Aphalo. I've reverted to using geom_table and no longer have a reproducible annotate example for you. – Lucas Eterovic Dec 22 '20 at 14:51
  • No problem! In fact, your message was useful as in the process I found a real bug that is now fixed. All the best. – Pedro J. Aphalo Dec 24 '20 at 11:57

0 Answers0