Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plotly color factor data stopped working - error package scale

I got an error in a plotly plot when using colors for factor data.

Example that gives an error for me:

library(plotly)
test <- data.frame(x=1:10, y = exp(1:10), z = rep(c('A', 'B'), each=5))
plot_ly(test, x = ~x, y = ~y, color = ~z)

I got this error:

Error in .Call("_scales_doColorRamp", PACKAGE = "scales", colors, x, alpha,  : 
  "_scales_doColorRamp" not available for .Call() for package "scales"

This suggest that it is an error due to an update in package scales.

Are there more that are facing this problem? I am using R version 3.4.1, plotly version 4.7.1 and scales version 0.5.0.

like image 686
JdP Avatar asked Aug 29 '17 13:08

JdP


1 Answers

Removing and reinstalling the package scales did solve this issue

like image 142
JdP Avatar answered Nov 08 '22 10:11

JdP