Error running the ggtern examples

Issue #4 new
Pierre Roudier created an issue

Getting the error message:

Error  in f(..., self = self) : unused argument (<environment>)

Full reproducible example:

> library(ggtern)
Loading required package: ggplot2
--
Consider donating at: http://ggtern.com
Even small amounts (say $10-50) are very much appreciated!
Remember to cite, run citation(package = 'ggtern') for further info.
--

Attaching package:ggternThe following objects are masked frompackage:ggplot2:

    %+%, aes, annotate, calc_element, ggplot, ggplot_build, ggplotGrob, ggplot_gtable, ggsave, layer_data,
    theme, theme_bw, theme_classic, theme_dark, theme_gray, theme_light, theme_linedraw, theme_minimal,
    theme_void

> n  = 5000
> df = data.frame(x     = runif(n),
+                 y     = runif(n),
+                 z     = runif(n),
+                 value = runif(n))
>  
> ggtern(df,aes(x,y,z)) + 
+   geom_hex_tern(bins=5,aes(value=value,fill=..count..))
Error in f(..., self = self) : unused argument (<environment>)
> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.4 LTS

Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.6.0
LAPACK: /usr/lib/lapack/liblapack.so.3.6.0

locale:
 [1] LC_CTYPE=en_NZ.UTF-8       LC_NUMERIC=C               LC_TIME=en_NZ.UTF-8        LC_COLLATE=en_NZ.UTF-8    
 [5] LC_MONETARY=en_NZ.UTF-8    LC_MESSAGES=en_NZ.UTF-8    LC_PAPER=en_NZ.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_NZ.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] ggtern_2.2.2       ggplot2_2.2.1.9000

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.15        magrittr_1.5        MASS_7.3-49         munsell_0.4.3       colorspace_1.3-2   
 [6] lattice_0.20-35     rlang_0.2.0.9000    stringr_1.3.0       plyr_1.8.4          tools_3.4.3        
[11] grid_3.4.3          gtable_0.2.0        withr_2.1.1.9000    yaml_2.1.16         lazyeval_0.2.1     
[16] tibble_1.4.2        bayesm_3.1-0.1      latex2exp_0.4.0     gridExtra_2.3       tensorA_0.36       
[21] energy_1.7-2        compositions_1.40-1 robustbase_0.92-8   stringi_1.1.6       compiler_3.4.3     
[26] DEoptimR_1.0-8      pillar_1.1.0        scales_0.5.0.9000   boot_1.3-20         proto_1.0.0

Comments (3)

  1. Nicholas Hamilton repo owner

    Pierre. I am aware of this issue, it is to do with significant changes within the ggplot2 version 2.2.1.9000, which I am yet to address.

    Unfortunately, you will have to downgrade to the previous version of ggplot2 (2.2.1), which I might add is the present official release on CRAN. Anything beyond (ie, the version 2.2.1.9000 which you have installed) is a development version yet to be released.

    Apologies for the inconvenience.

  2. Kevin Weitemier

    I think the same issue is happening with ggplot2 version 3.0.0 recently released on CRAN. Though note the error message is slightly different: Error in f(..., self = self) : unused argument (plot$coordinates)

    > library(ggtern)
    Loading required package: ggplot2
    --
    Consider donating at: http://ggtern.com
    Even small amounts (say $10-50) are very much appreciated!
    Remember to cite, run citation(package = 'ggtern') for further info.
    --
    
    Attaching package: ‘ggtern’
    
    The following objects are masked from ‘package:ggplot2’:
    
        %+%, aes, annotate, calc_element, ggplot, ggplot_build, ggplot_gtable, ggplotGrob, ggsave, layer_data, theme, theme_bw,
        theme_classic, theme_dark, theme_gray, theme_light, theme_linedraw, theme_minimal, theme_void
    
    > data("Feldspar")
    > base = ggtern(data=Feldspar,aes(Ab,An,Or))
    > base + geom_point()
    Error in f(..., self = self) : unused argument (plot$coordinates)
    > sessionInfo()
    R version 3.5.1 (2018-07-02)
    Platform: x86_64-w64-mingw32/x64 (64-bit)
    Running under: Windows >= 8 x64 (build 9200)
    
    Matrix products: default
    
    locale:
    [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
    [4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    
    
    attached base packages:
    [1] stats     graphics  grDevices utils     datasets  methods   base     
    
    other attached packages:
    [1] ggtern_2.2.3  ggplot2_3.0.0
    
    loaded via a namespace (and not attached):
     [1] Rcpp_0.12.17        bindr_0.1.1         magrittr_1.5        MASS_7.3-50         tidyselect_0.2.4    munsell_0.5.0      
     [7] colorspace_1.3-2    lattice_0.20-35     R6_2.2.2            rlang_0.2.1         stringr_1.3.1       plyr_1.8.4         
    [13] dplyr_0.7.6         tools_3.5.1         grid_3.5.1          gtable_0.2.0        withr_2.1.2         yaml_2.1.19        
    [19] lazyeval_0.2.1      assertthat_0.2.0    bayesm_3.1-0.1      tibble_1.4.2        latex2exp_0.4.0     bindrcpp_0.2.2     
    [25] energy_1.7-4        tensorA_0.36        gridExtra_2.3       purrr_0.2.5         compositions_1.40-2 robustbase_0.93-1  
    [31] glue_1.2.0          stringi_1.1.7       DEoptimR_1.0-8      compiler_3.5.1      pillar_1.2.3        scales_0.5.0
    
  3. Kleverton Júnio Silva

    With the ggplot2 version 3.3.5 I was able to run the R script on PowerBi Desktop, but it didn't run in my workspace at (app.powerbi.com), showing the error message "Error in f(..., self = self) : unused argument (<environment>)". When making an attempt to downgrade to version 2.1.0 of ggplot2, I'm not able to run the script neither on PowerBi Desktop and even less on Wokspace (app.powerbi.com).
    Is presenting
    Error Message:
    Error in R script.
    Loading required packages: ggtern
    Failed with error: 'package 'ggplot2' 2.1.0 was found, but >= 3.3.5 is required by 'ggtern''
    Also: Warning message:
    package 'ggtern' was built under R version 4.1.1
    Error: package 'ggplot2' 2.1.0 was found, but >= 3.3.5 is required by 'ggtern'
    Also: Warning message:
    package 'ggtern' was built under R version 4.1.1
    Execution interrupted

  4. Log in to comment