talgalili / d3heatmap

A D3.js-based heatmap htmlwidget for R
Other
237 stars 95 forks source link

D3heatmap redifining print function for characters and numerics #91

Open eloimercier-stemcell opened 3 years ago

eloimercier-stemcell commented 3 years ago

D3heatmap redefines the base function "print" for character and numeric. The help menu suggests that the d3heatmap::print function should only be called on a d3heatmapGadget. As you can imagine, every piece of code using the base::print function is now broken after loading d3heatmap.

> print("a")
[1] "a"
> print(2)
[1] 2
> library(d3heatmap)

======================
Welcome to d3heatmap version 0.9.0
[...]
Attaching package: ‘d3heatmap’

The following objects are masked from ‘package:base’:

    print, save

> print("a")
Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘print’ for signature ‘"character"’

> print(2)
Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘print’ for signature ‘"numeric"’

> sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)

Matrix products: default

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

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

other attached packages:
[1] d3heatmap_0.9.0

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.6        knitr_1.33        magrittr_2.0.1    xtable_1.8-4      R6_2.5.0          rlang_0.4.11      fastmap_1.1.0     stringr_1.4.0    
 [9] plyr_1.8.6        gProfileR_0.7.0   tools_4.1.0       DT_0.18           xfun_0.24         png_0.1-7         htmltools_0.5.1.1 shinyjs_2.0.0    
[17] ellipsis_0.3.2    digest_0.6.27     lifecycle_1.0.0   zip_2.2.0         shiny_1.6.0       reshape2_1.4.4    later_1.2.0       base64enc_0.1-3  
[25] htmlwidgets_1.5.3 promises_1.2.0.1  evaluate_0.14     mime_0.11         rmarkdown_2.9     openxlsx_4.2.4    limma_3.48.1      stringi_1.6.2    
[33] compiler_4.1.0    httpuv_1.6.1 
kforthman commented 2 years ago

I have also run into this issue. I have to detach d3heatmap in order to use the print function.

talgalili commented 2 years ago

If any of you are interested in suggested a PR, I'd be happy to review it. I don't see myself solving this anytime soon, sadly.

T

On Thu, Jan 20, 2022 at 7:08 PM Katherine (Katie) Forthman < @.***> wrote:

I have also run into this issue. I have to detach d3heatmap in order to use the print function.

— Reply to this email directly, view it on GitHub https://github.com/talgalili/d3heatmap/issues/91#issuecomment-1017725662, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHOJBX6WCLDUIVLSG4QGJ3UXA6QPANCNFSM4746XQYQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>