Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in mutate_impl(.data, dots) : Column x is of unsupported type quoted call #420

Closed
peeyooshc opened this issue Mar 25, 2018 · 16 comments

Comments

@peeyooshc
Copy link

Hoping you can help, I upgraded a package, and now highcharter has stopped working.

while executing this example
hchart(mpg, "point", hcaes(x = displ, y = cty))

sessionInfo:

R version 3.3.3 (2017-03-06)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: macOS Sierra 10.12.5

locale:
[1] en_NZ.UTF-8/en_NZ.UTF-8/en_NZ.UTF-8/C/en_NZ.UTF-8/en_NZ.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] bindrcpp_0.2      dplyr_0.7.4       highcharter_0.5.0

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.14       pillar_1.2.1       plyr_1.8.4         bindr_0.1.1       
 [5] xts_0.10-1         tools_3.3.3        stlplus_0.5.1      digest_0.6.13     
 [9] lubridate_1.7.3    jsonlite_1.5       tibble_1.4.2       gtable_0.2.0      
[13] yaImpute_1.0-29    nlme_3.1-131       lattice_0.20-34    pkgconfig_2.0.1   
[17] rlang_0.2.0.9001   psych_1.7.8        igraph_1.1.2       shiny_1.0.5       
[21] curl_3.1           parallel_3.3.3     stringr_1.2.0      htmlwidgets_0.9   
[25] grid_3.3.3         data.table_1.10.4  glue_1.2.0         R6_2.2.2          
[29] foreign_0.8-67     TTR_0.23-2         ggplot2_2.2.1.9000 tidyr_0.8.0       
[33] purrr_0.2.4        reshape2_1.4.3     magrittr_1.5       scales_0.5.0.9000 
[37] htmltools_0.3.6    rlist_0.4.6.1      quantmod_0.4-12    assertthat_0.2.0  
[41] mnormt_1.5-5       mime_0.5           xtable_1.8-2       colorspace_1.2-6  
[45] httpuv_1.3.5       stringi_1.1.5      lazyeval_0.2.1     munsell_0.4.3     
[49] broom_0.4.3        zoo_1.8-1       
@jbkunst
Copy link
Owner

jbkunst commented Mar 25, 2018

Hi @peeyooshc , try to update all the packages if is possible, specially tidyverse

@peeyooshc
Copy link
Author

I've tried but no good. I think it has to do wth changes to how quosures are handled in rlang, but I can't seem to go back. Didn't manage to implement packrat on this project

@jbkunst
Copy link
Owner

jbkunst commented Mar 25, 2018

R version 3.4.1 (2017-06-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=Spanish_Spain.1252  LC_CTYPE=Spanish_Spain.1252   
[3] LC_MONETARY=Spanish_Spain.1252 LC_NUMERIC=C                  
[5] LC_TIME=Spanish_Spain.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods  
[7] base     

other attached packages:
[1] highcharter_0.5.0.9999

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.15        pillar_1.1.0        compiler_3.4.1     
 [4] plyr_1.8.4          bindr_0.1           tools_3.4.1        
 [7] xts_0.10-1          digest_0.6.15       jsonlite_1.5       
[10] lubridate_1.7.2     tibble_1.4.2        nlme_3.1-131       
[13] lattice_0.20-35     pkgconfig_2.0.1     rlang_0.1.6        
[16] psych_1.7.8         igraph_1.1.2        curl_3.1           
[19] yaml_2.1.16         parallel_3.4.1      bindrcpp_0.2       
[22] dplyr_0.7.4         stringr_1.2.0       htmlwidgets_1.0    
[25] grid_3.4.1          data.table_1.10.4-3 glue_1.2.0         
[28] R6_2.2.2            foreign_0.8-69      whisker_0.3-2      
[31] tidyr_0.8.0         reshape2_1.4.3      purrr_0.2.4        
[34] TTR_0.23-2          magrittr_1.5        htmltools_0.3.6    
[37] rlist_0.4.6.1       assertthat_0.2.0    quantmod_0.4-12    
[40] mnormt_1.5-5        stringi_1.1.6       broom_0.4.3        
[43] zoo_1.8-1    

@PaulC91
Copy link
Contributor

PaulC91 commented Mar 26, 2018

I was getting the same error message on all highcharts as of today after updating another package. It looks like I've fixed it by reverting rlang back to 0.1.6. as per @jbkunst seesion info. This meant I also had to revert ggplot2 back from the dev version because I was getting this error when trying to load the tidyverse:

Error: package or namespace load failed for ‘ggplot2’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 namespace ‘rlang’ 0.1.6 is already loaded, but >= 0.2.0.9001 is required

I'm not sure what else changed because highcharter was working fine with the dev version of ggplot2 until today. Any ideas?

My sessionInfo() with highcharter loaded now looks like this:

R version 3.4.4 (2018-03-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252    LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C                            LC_TIME=English_United Kingdom.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] highcharter_0.5.0

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.16        pillar_1.1.0        compiler_3.4.4      plyr_1.8.4          bindr_0.1           tools_3.4.4        
 [7] xts_0.10-2          digest_0.6.15       jsonlite_1.5        lubridate_1.7.2     tibble_1.4.2        nlme_3.1-131.1     
[13] lattice_0.20-35     pkgconfig_2.0.1     rlang_0.1.6         psych_1.7.8         igraph_1.2.1        curl_2.8.1         
[19] yaml_2.1.18         parallel_3.4.4      bindrcpp_0.2        dplyr_0.7.4         stringr_1.2.0       htmlwidgets_1.0    
[25] grid_3.4.4          data.table_1.10.4-3 glue_1.2.0          R6_2.2.2            foreign_0.8-69      tidyr_0.7.1        
[31] reshape2_1.4.3      purrr_0.2.4         TTR_0.23-2          magrittr_1.5        htmltools_0.3.6     rlist_0.4.6.1      
[37] assertthat_0.2.0    quantmod_0.4-12     mnormt_1.5-5        stringi_1.1.7       broom_0.4.3         zoo_1.8-1 

@jbkunst
Copy link
Owner

jbkunst commented Mar 26, 2018

I think gglpot2 will make a important upgrade with non standard evaluation using rlang. I guess that's is the reason of the problem. I will look into it, sorry for the problems but I'm a NSE ignorant by now.

Any news i got I'll post here.

@peeyooshc
Copy link
Author

Sadly I can't go back in ggplot2 versions. For me it was caused by installing the package trelliscopejs which updated packages.

Oh well, off to go and "upgrade" a large, complex app.

Thanks for checking and your prompt response. If I find anything I'll post here.

@peeyooshc
Copy link
Author

Ok, so the issues seems to be an update in ggplot2.

Your ok to go up to rlang_0.2.0.9001 with no issues.

The issue in ggplot2 seems to be this commit this but I can't be sure. May have implications for highcharter.

To get back to a version of ggplot2 that doesn't contain that commit, use this tool

https://cran.r-project.org/web/packages/githubinstall/vignettes/githubinstall.html

After a bit of experimentation, I settled on this version from the ggplot2 master branch.
gh_install_packages("ggplot2", ref = "49619b7", dependencies = FALSE)

And going forward everything will have a dep = FALSE, as it does an intelligent version of package import that doesn't upgrade pre-installed packages.

@tungttnguyen
Copy link

@peeyooshc : Thanks for sharing! Does the commit you referred to have the ability to use !! or !!! in ggplot.

I'm using the latest ggplot dev and also ran into the same problem with highcharter

@peeyooshc
Copy link
Author

No it doesn't let me use the !! or !!! syntax. You can use the aes_ in ggplot, or alternatively try importing newer commits of ggplot from the source repository till it works but doesn't break highcharter.

If you need to dynamically pass in variables to ggplot, and don't want to use aes_, you can declare the variable using my_var <- as.name("variable_you_want") and then in ggplot call it using

ggplot(my_data, aes(x=date, y = eval(my_var)) + ...

I suspect there will need to be some refactoring of how highcharter passes ... around to work with the newer release of ggplot but haven't had time to check it out.

@tungttnguyen
Copy link

tungttnguyen commented Apr 3, 2018

Thanks!

I think the error has something to do with mutate_mapping in highcharter
https://github.com/jbkunst/highcharter/blob/master/R/api-hc-hc_add_series.R#L403

mutate_mapping <- function(data, mapping, drop = FALSE) {
  
  stopifnot(is.data.frame(data), inherits(mapping, "hcaes"), inherits(drop, "logical"))
  
  # http://rmhogervorst.nl/cleancode/blog/2016/06/13/NSE_standard_evaluation_dplyr.html
  tran <- as.character(mapping)
  newv <- names(mapping)

  data <- dplyr::mutate_(data, .dots = setNames(tran, newv))
  
  # Reserverd  highcharts names (#241)
  if(has_name(data, "series"))
    data <- rename_(data, "seriess" = "series")
  
  if(drop)
    data <- select_(data, .dots = names(mapping))
  
  data
  
}

which is called from here
https://github.com/jbkunst/highcharter/blob/master/R/hchart.R#L34

data <- mutate_mapping(object, mapping)

@jbkunst can probably modify those codes based on akrun's answers on SO: 1st, 2nd

I will look into it, sorry for the problems but I'm a NSE ignorant by now.

Here is an excellent blog post about tidyeval to help you warm up :) http://colinfay.me/tidyeval-1/. See also Hadley's 5min video

-- Tung

@sid1501
Copy link

sid1501 commented Jul 4, 2018

Hi! So I reinstalled my R studio today and installed all packages again. Graphs that were working before are not working.
Here is my session info. Please help.

In the graphs where I have used hcaes function, I get the error -
Error in mutate_impl(.data, dots) :
Column x is of unsupported type quoted call

Session info -----------------------------------------------------------------------------------------------
setting value
version R version 3.5.0 (2018-04-23)
system x86_64, darwin17.5.0
ui RStudio (1.1.453)
language (EN)
collate en_US.UTF-8
tz America/Los_Angeles
date 2018-07-03

Packages ---------------------------------------------------------------------------------------------------
package * version date source
acepack 1.4.1 2016-10-29 CRAN (R 3.5.0)
assertthat 0.2.0 2017-04-11 CRAN (R 3.5.0)
ATRItools * 1.0-57 2018-07-03 local
backports 1.1.2 2017-12-13 CRAN (R 3.5.0)
base * 3.5.0 2018-05-02 local
base64enc 0.1-3 2015-07-28 CRAN (R 3.5.0)
bindr 0.1.1 2018-03-13 CRAN (R 3.5.0)
bindrcpp * 0.2.2 2018-03-29 CRAN (R 3.5.0)
bitops * 1.0-6 2013-08-17 CRAN (R 3.5.0)
boxr * 0.3.4 2017-01-12 CRAN (R 3.5.0)
broom 0.4.5 2018-07-03 CRAN (R 3.5.0)
checkmate 1.8.5 2017-10-24 CRAN (R 3.5.0)
cluster 2.0.7-1 2018-04-13 CRAN (R 3.5.0)
codetools 0.2-15 2016-10-05 CRAN (R 3.5.0)
colorspace 1.3-2 2016-12-14 CRAN (R 3.5.0)
compiler 3.5.0 2018-05-02 local
contrast 0.21 2016-09-22 CRAN (R 3.5.0)
crayon 1.3.4 2017-09-16 CRAN (R 3.5.0)
crosstalk 1.0.0 2016-12-21 CRAN (R 3.5.0)
curl 3.2 2018-03-28 CRAN (R 3.5.0)
data.table 1.11.4 2018-05-27 CRAN (R 3.5.0)
datasets * 3.5.0 2018-05-02 local
devtools * 1.13.6 2018-06-27 CRAN (R 3.5.0)
digest 0.6.15 2018-01-28 CRAN (R 3.5.0)
Dmisc * 1.0-29 2018-07-03 local
dplyr * 0.7.6 2018-06-29 CRAN (R 3.5.0)
DT * 0.4 2018-01-30 CRAN (R 3.5.0)
evaluate 0.10.1 2017-06-24 CRAN (R 3.5.0)
foreign * 0.8-70 2017-11-28 CRAN (R 3.5.0)
formattable * 0.2.0.1 2016-08-05 CRAN (R 3.5.0)
Formula * 1.2-3 2018-05-03 CRAN (R 3.5.0)
git2r 0.21.0 2018-01-04 CRAN (R 3.5.0)
githubinstall * 0.2.2 2018-02-18 CRAN (R 3.5.0)
glue 1.2.0 2017-10-29 CRAN (R 3.5.0)
graphics * 3.5.0 2018-05-02 local
grDevices * 3.5.0 2018-05-02 local
grid 3.5.0 2018-05-02 local
gridExtra 2.3 2017-09-09 CRAN (R 3.5.0)
gtable 0.2.0 2016-02-26 CRAN (R 3.5.0)
highcharter * 0.5.0 2017-01-17 CRAN (R 3.5.0)
Hmisc * 4.1-1 2018-01-03 CRAN (R 3.5.0)
hms 0.4.2 2018-03-10 CRAN (R 3.5.0)
htmlTable 1.12 2018-05-26 CRAN (R 3.5.0)
htmltools 0.3.6 2017-04-28 CRAN (R 3.5.0)
htmlwidgets 1.2 2018-04-19 CRAN (R 3.5.0)
httpuv 1.4.4.2 2018-07-02 CRAN (R 3.5.0)
httr * 1.3.1 2017-08-20 CRAN (R 3.5.0)
igraph 1.2.1 2018-03-10 CRAN (R 3.5.0)
jsonlite * 1.5 2017-06-01 CRAN (R 3.5.0)
kableExtra * 0.9.0 2018-05-21 CRAN (R 3.5.0)
knitr * 1.20 2018-02-20 CRAN (R 3.5.0)
later 0.7.3 2018-06-08 CRAN (R 3.5.0)
lattice * 0.20-35 2017-03-25 CRAN (R 3.5.0)
latticeExtra 0.6-28 2016-02-09 CRAN (R 3.5.0)
lazyeval 0.2.1 2017-10-29 CRAN (R 3.5.0)
lubridate * 1.7.4 2018-04-11 CRAN (R 3.5.0)
magrittr 1.5 2014-11-22 CRAN (R 3.5.0)
MASS 7.3-49 2018-02-23 CRAN (R 3.5.0)
Matrix 1.2-14 2018-04-13 CRAN (R 3.5.0)
MatrixModels 0.4-1 2015-08-22 CRAN (R 3.5.0)
memoise 1.1.0 2017-04-21 CRAN (R 3.5.0)
methods * 3.5.0 2018-05-02 local
mime 0.5 2016-07-07 CRAN (R 3.5.0)
mnormt 1.5-5 2016-10-15 CRAN (R 3.5.0)
multcomp 1.4-8 2017-11-08 CRAN (R 3.5.0)
munsell 0.5.0 2018-06-12 CRAN (R 3.5.0)
mvtnorm 1.0-8 2018-05-31 CRAN (R 3.5.0)
NIC * 1.0 2018-07-03 local
nlme 3.1-137 2018-04-07 CRAN (R 3.5.0)
nnet 7.3-12 2016-02-02 CRAN (R 3.5.0)
parallel 3.5.0 2018-05-02 local
pillar 1.2.3 2018-05-25 CRAN (R 3.5.0)
pkgconfig 2.0.1 2017-03-21 CRAN (R 3.5.0)
plyr 1.8.4 2016-06-08 CRAN (R 3.5.0)
polspline 1.1.13 2018-06-14 CRAN (R 3.5.0)
promises 1.0.1 2018-04-13 CRAN (R 3.5.0)
psych 1.8.4 2018-05-06 CRAN (R 3.5.0)
purrr * 0.2.5 2018-05-29 CRAN (R 3.5.0)
quantmod 0.4-13 2018-04-13 CRAN (R 3.5.0)
quantreg 5.36 2018-05-29 CRAN (R 3.5.0)
R6 2.2.2 2017-06-17 CRAN (R 3.5.0)
RColorBrewer 1.1-2 2014-12-07 CRAN (R 3.5.0)
Rcpp 0.12.17 2018-05-18 CRAN (R 3.5.0)
RCurl * 1.95-4.10 2018-01-04 CRAN (R 3.5.0)
readr 1.1.1 2017-05-16 CRAN (R 3.5.0)
reshape2 1.4.3 2017-12-11 CRAN (R 3.5.0)
rlang 0.2.0 2018-02-20 url
rlist 0.4.6.1 2016-04-04 CRAN (R 3.5.0)
rmarkdown 1.10 2018-06-11 CRAN (R 3.5.0)
rms * 5.1-2 2018-01-07 CRAN (R 3.5.0)
rpart 4.1-13 2018-02-23 CRAN (R 3.5.0)
rprojroot 1.3-2 2018-01-03 CRAN (R 3.5.0)
rstudioapi 0.7 2017-09-07 CRAN (R 3.5.0)
rvest 0.3.2 2016-06-17 CRAN (R 3.5.0)
sandwich 2.4-0 2017-07-26 CRAN (R 3.5.0)
scales 0.5.0 2017-08-24 CRAN (R 3.5.0)
shiny * 1.1.0 2018-05-17 CRAN (R 3.5.0)
shinydashboard * 0.7.0 2018-03-21 CRAN (R 3.5.0)
shinyjs * 1.0 2018-01-08 CRAN (R 3.5.0)
SparseM * 1.77 2017-04-23 CRAN (R 3.5.0)
splines 3.5.0 2018-05-02 local
stats * 3.5.0 2018-05-02 local
stringi 1.2.3 2018-06-12 CRAN (R 3.5.0)
stringr * 1.3.1 2018-05-10 CRAN (R 3.5.0)
survival * 2.41-3 2017-04-04 CRAN (R 3.5.0)
TH.data 1.0-8 2017-01-23 CRAN (R 3.5.0)
tibble 1.4.2 2018-01-22 CRAN (R 3.5.0)
tidyr * 0.8.1 2018-05-18 CRAN (R 3.5.0)
tidyselect 0.2.4 2018-02-26 CRAN (R 3.5.0)
tools 3.5.0 2018-05-02 local
TTR 0.23-3 2018-01-24 CRAN (R 3.5.0)
utils * 3.5.0 2018-05-02 local
viridisLite 0.3.0 2018-02-01 CRAN (R 3.5.0)
withr 2.1.2 2018-03-15 CRAN (R 3.5.0)
WriteXLS * 4.0.0 2015-12-07 CRAN (R 3.5.0)
XML * 3.98-1.11 2018-06-11 CRAN (R 3.5.0)
xml2 1.2.0 2018-01-24 CRAN (R 3.5.0)
xtable 1.8-2 2016-02-05 CRAN (R 3.5.0)
xts 0.10-2 2018-03-14 CRAN (R 3.5.0)
yaml 2.1.19 2018-05-01 CRAN (R 3.5.0)
zoo 1.8-2 2018-06-11 CRAN (R 3.5.0)

@pwildenhain
Copy link

I've also been experiencing this error message again, I wonder if it has anything to do with the most recent ggplot2 release.

@tungttnguyen
Copy link

I've just tested many examples here
#423

Everything is still working for me on the latest GitHub dev highcharter & ggplot2 3.0.0

@pwildenhain
Copy link

pwildenhain commented Jul 6, 2018

Whoops! I didn't have the latest dev version of highcharter. @jbkunst do you have a timeline for when v 0.6.0 will be released?

@sid1501
Copy link

sid1501 commented Jul 7, 2018 via email

@josephgp1
Copy link

josephgp1 commented Aug 10, 2018

I had the same issue. Installed the development version 0.6.0. Now it working with no issues.

Or Modifying the code as below will work.

highchart() %>%
hc_chart(type = "point") %>%
hc_xAxis(categories =mpg$displ) %>%
hc_add_series(data = mpg$cty,
name = "mpg data",colorByPoint = TRUE)%>%
hc_add_theme(hc_theme_google())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants