daattali / colourpicker

🎨 A colour picker tool for Shiny and for selecting colours in plots (in R)
https://daattali.com/shiny/colourInput/
Other
215 stars 28 forks source link

Some problem #26

Closed 905168041 closed 6 years ago

905168041 commented 6 years ago

When I install muxViz, I do the step library(colourpicker), why there is a error message: colourInput() has been moved to the 'colourpicker' package.

daattali commented 6 years ago

I'm not sure what muxViz is, but that error is an error that comes from the shinyjs package. The colourInput() function used to be in the shinyjs package but it has moved into the colourpicker package. So when you get that error, it sounds like you're trying (directly or indirectly) to use the colourInput() function from shinyjs.

905168041 commented 6 years ago

I'm following the step to test this function library(shiny) shinyApp( ui = fluidPage( colourInput("col", "Select colour", "purple"), plotOutput("plot") ), server = function(input, output) { output$plot <- renderPlot({ set.seed(1) plot(rnorm(50), bg = input$col, col = input$col, pch = 21) }) } ) it also have the same error:colourInput() has been moved to the 'colourpicker' package. When I try library(colourpicker) at first, it will run normal. But when I install muxViz I do library(colourpicker) at first, it can't solve the error. I don't konw what can I do next.

daattali commented 6 years ago

The error you are getting is because it's trying to use the function from the shinyjs package. If you restart your R session, running your code will not work because neither shinyjs nor colourpicker packages are loaded. If you load colourpicker and then the code that you pasted, you will have no problem. If instead you load shinyjs and then the code you pasted, you'll see the error.

Again, I don't know what muxViz is, but it sounds like perhaps it's using an old version of shinyjs, and they should be using colourpicker instead.

905168041 commented 6 years ago

Ok, thanks for your help. My English is not good. If I have some mistake in language, hopes for forgive.

daattali commented 6 years ago

I informed muxViz about this error, they should be able to fix it on their end.

905168041 commented 6 years ago

Thank you

sugargon commented 6 years ago

muxViz hasn't fixed the problem but you can solve it by changing the following sections in the R scripts: In the unzipped file "muxViz-master", open "muxVizGUI.R" and add the following on line 90:

if(!require(colourpicker)){
  install.packages("colourpicker")
}

Also, open "ui.R" and find & replace shinyjs::colourInput with colourpicker::colourInput

save the edits, then run again source('muxVizGUI.R')

daattali commented 6 years ago

thank you @sugargon

daattali commented 6 years ago

reference to issue on muxviz: https://github.com/manlius/muxViz/issues/5

salmanahmed84 commented 2 years ago

Hi, I am using RtutoR package for EDA. While using the shiny dashboard, Just after clicking the aesthetics section, generating below error and nothing works. Facing same problem "Warning: Error in : colourInput() has been moved to the 'colourpicker' package."

I have installed the latest version of colourpicker, still same issue. Any idea how to sort this?

Thanks