Error : package or namespace load failed for ‘imputeTS

817 Views Asked by At

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?

1

There are 1 best solutions below

0
Steffen Moritz On

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.