Plotly: Warning: replacing previous import 'ggplot2::last_plot' by 'plotly::last_plot' when loading 'heatmaply'

Created on 23 May 2016  路  4Comments  路  Source: ropensci/plotly

It seems that since both ggplot2 and plotly use last_plot that this triggers a warning when importing from both packages, see:
https://travis-ci.org/talgalili/heatmaply/builds/132391290

I am not sure how to solve this.

Most helpful comment

This happens because you have

import(ggplot2)
import(plotly)

in your DESCRIPTION. I hope to have a more general solution down the road, but for now you could use importFrom to import just the plotly functions you need internally, as this post describes -- http://stackoverflow.com/questions/10325231/when-writing-my-own-r-package-i-cant-seem-to-get-other-packages-to-import-corr

All 4 comments

This happens because you have

import(ggplot2)
import(plotly)

in your DESCRIPTION. I hope to have a more general solution down the road, but for now you could use importFrom to import just the plotly functions you need internally, as this post describes -- http://stackoverflow.com/questions/10325231/when-writing-my-own-r-package-i-cant-seem-to-get-other-packages-to-import-corr

Thanks @cpsievert
I've now made this change so I won't have this conflict in heatmaply.

A longer term solution (especially as more package will likely import from both plotly and ggplot), is to rename last_plot to something like last_plotly.

What do you think?

We might not even need plotly::last_plot() going forward...it really only exists because of the way non-standard evaluation currently works which will hopefully change for the better within the next couple months

last_plot is now deprecated as of version 4.0

Was this page helpful?
0 / 5 - 0 ratings