ClaraHapp / funData

An S4 class for functional data in R
GNU General Public License v2.0
14 stars 2 forks source link

funData::ggplot overwrites standard methods from ggplot2 without replacement #15

Closed fabian-s closed 6 years ago

fabian-s commented 6 years ago

if funData is loaded after ggplot2, ggplot cannot be used for data.frames anymore:

library(ggplot2)
library(funData)
ggplot(mtcars) + geom_boxplot(aes(y = mpg))

 Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘ggplot’ for signature ‘"data.frame"’ 
3.
stop(gettextf("unable to find an inherited method for function %s for signature %s", 
    sQuote(fdef@generic), sQuote(cnames)), domain = NA) 
2.
(function (classes, fdef, mtable) 
{
    methods <- .findInheritedMethods(classes, fdef, mtable)
    if (length(methods) == 1L)  ... 
1.
ggplot(mtcars) 

showMethods("ggplot") 

Function: ggplot (package funData)
data="funData"
data="irregFunData"
data="multiFunData"

sessionInfo()
R version 3.4.4 (2018-03-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.5 LTS

Matrix products: default
BLAS: /usr/lib/atlas-base/atlas/libblas.so.3.0
LAPACK: /usr/lib/lapack/liblapack.so.3.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=de_DE.UTF-8       
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=de_DE.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=de_DE.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] funData_1.3   ggplot2_3.0.0

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.18     rstudioapi_0.7   bindr_0.1.1      magrittr_1.5     tidyselect_0.2.4
 [6] munsell_0.5.0    colorspace_1.3-2 R6_2.2.2         rlang_0.2.0.9001 foreach_1.4.4   
[11] plyr_1.8.4       dplyr_0.7.6      tools_3.4.4      grid_3.4.4       gtable_0.2.0    
[16] withr_2.1.2      iterators_1.0.10 yaml_2.1.18      abind_1.4-5      lazyeval_0.2.1  
[21] assertthat_0.2.0 tibble_1.4.2     crayon_1.3.4     bindrcpp_0.2.2   purrr_0.2.4     
[26] codetools_0.2-15 glue_1.3.0       compiler_3.4.4   pillar_1.3.0     scales_1.0.0    
[31] pkgconfig_2.0.1 
#> Error: <text>:4:7: unexpected symbol
#> 3: ggplot(mtcars) + geom_boxplot(aes(y = mpg))
#> 4:  Hide Traceback
#>          ^

Created on 2018-08-17 by the reprex package (v0.2.0).

ClaraHapp commented 6 years ago

Fixed in 80f0b850152aaabfd11ae9f042fcb3e1a7eb03d7 Will be published with the next version of funData.

ClaraHapp commented 6 years ago

Fixed in version 1.3-1