0

I'm trying to load inputeTS package in my R version 3.6.3 running on databricks. I wrote following command

install.packages('imputeTS',dependencies=TRUE)

I'm getting message

The downloaded source packages are in
‘/tmp/RtmpgzU1J2/downloaded_packages

But while trying to load the package using

library('imputeTS')

I'm getting error message

 package or namespace load failed for ‘imputeTS’: Error : package or namespace load failed for ‘imputeTS’: object ‘after_stat’ is not exported by 'namespace:ggplot2'

Can you suggest me how to resolve the issue?

Steffen Moritz
  • 7,277
  • 11
  • 36
  • 55
JDoe
  • 423
  • 2
  • 9
  • 19
  • What is your version of `ggplot2`? What is the return value of `packageVersion('ggplot2')`? In `‘3.3.2’` that error doesn't occur, time to update? – Rui Barradas Dec 31 '20 at 09:57
  • @RuiBarradas, Thanks. I will update `ggplot2` – JDoe Jan 04 '21 at 07:13
  • Hi @RuiBarradas, I have ggplot2 version 3.2.1. I tried to upgrade it using `update.packages("ggplot2")` but after running this, `packageVersion('ggplot2')` is showing 3.2.1. Can you please suggest me how do I upgrade it? – JDoe Jan 04 '21 at 11:36
  • 1
    Try `install.packages("ggplot2")`. If you have upgraded R and want to update *all* installed packages use `update.packages`. – Rui Barradas Jan 04 '21 at 11:49

1 Answers1

1

This issue can be resolved by installing a newer version of ggplot2 (which is used internally by imputeTS to create the plots)

Just run

 install.packages("ggplot2")

And then go on with the installation of imputeTS

 install.packages('imputeTS',dependencies=TRUE)

It is a known issue (see https://github.com/SteffenMoritz/imputeTS/issues/48 ) and with the next CRAN version there should be an update that includes a better error message indicating that you need to update your ggplot2 version.

Steffen Moritz
  • 7,277
  • 11
  • 36
  • 55