heatmaply icon indicating copy to clipboard operation
heatmaply copied to clipboard

Heatmaply does not show plot

Open bluejek128 opened this issue 3 years ago • 15 comments

I would like to use heatmaply to generate some plots, but plot does not show when I run the code (see image)- the command just indefinitely pends and the only way to kill the command is to force quit Rstudio on my mac. I tried reinstalling the package, as well as reinstalling R, Rstudio, and all other packages to no avail. I am not getting an error message. What could be the problem and any tips to resolve this? Thanks!!

Screen Shot 2021-03-10 at 3 22 54 PM

bluejek128 avatar Mar 10 '21 21:03 bluejek128

the only thing I could think of that changed recently is that I updated the makefile for the local compiler for a different package to gcc instead of clang. not sure whether this matters, but didn’t think it should since i was able to install the package succesfully

bluejek128 avatar Mar 10 '21 21:03 bluejek128

I'm having the same issue. Please let me know if there is a fix. Thanks

feteezuk avatar May 17 '21 19:05 feteezuk

I've not got a mac to test this on; no issues on Ubuntu. Will investigate further if github actions shows similar errors, otherwise I suspect you're on your own. https://github.com/talgalili/heatmaply/commit/2a75c62a61df568d6216d99c30e3cd9a5fe4f8ee

Would probably help if you can identify the line of code that hangs by using debug.

alanocallaghan avatar May 17 '21 19:05 alanocallaghan

#install.packages("corrplot")

library(tidyverse) library(dplyr) library(reshape) library(matrixcalc) library(ggplot2) #library(corrplot) #used for plotting correlation

getwd() #displays your working directory setwd("/2020football.csv")

football <- read.csv("Desktop/football.csv", na="0") head(football)

quarterbacks <- football %>% select(everything()) %>% filter(FantPos=="QB")

View(quarterbacks) str(quarterbacks)

quarterbacks_corr <- quarterbacks %>% select_if(is.numeric) %>% select(-X2.00.PM, -Y.R,-VBD)

head(quarterbacks_corr)

#head(quarterbacks_corr) str(quarterbacks_corr) summary(quarterbacks_corr)

colSums(is.na(quarterbacks_corr)) nrow(quarterbacks_corr) # 71 rows of players

quarterbacks_corr[is.na(quarterbacks_corr)]<-0 #changes na values to 0 nrow(quarterbacks_corr) #71 rows - number of rows stays the same.

quarterbacks_corr <- round(cor(quarterbacks_corr),2)

#corrplot(quarterbacks_corr, type="lower")

#corrplot(quarterbacks_corr, type="upper", method="number")

mtcars<- cor(mtcars)

heatmap(mtcars)

library(heatmaply)

heatmaply(mtcars) # <<<<<====CODE GETS STUCKS HERE. It just loads and loads, but does not complete itself.

feteezuk avatar May 17 '21 20:05 feteezuk

Any chance to make a reproducible example? (Say, with toy data?!)

On Mon, May 17, 2021, 23:46 Jonathan H. @.***> wrote:

#install.packages("corrplot")

library(tidyverse) library(dplyr) library(reshape) library(matrixcalc) library(ggplot2) #library(corrplot) #used for plotting correlation

getwd() #displays your working directory setwd("/2020football.csv")

football <- read.csv("Desktop/football.csv", na="0") head(football)

quarterbacks <- football %>% select(everything()) %>% filter(FantPos=="QB")

View(quarterbacks) str(quarterbacks)

quarterbacks_corr <- quarterbacks %>% select_if(is.numeric) %>% select(-X2.00.PM, -Y.R,-VBD)

head(quarterbacks_corr)

#head(quarterbacks_corr) str(quarterbacks_corr) summary(quarterbacks_corr)

colSums(is.na(quarterbacks_corr)) nrow(quarterbacks_corr) # 71 rows of players

quarterbacks_corr[is.na(quarterbacks_corr)]<-0 #changes na values to 0 nrow(quarterbacks_corr) #71 https://github.com/talgalili/heatmaply/issues/71 rows - number of rows stays the same.

quarterbacks_corr <- round(cor(quarterbacks_corr),2)

#corrplot(quarterbacks_corr, type="lower")

#corrplot(quarterbacks_corr, type="upper", method="number")

mtcars<- cor(mtcars)

heatmap(mtcars)

library(heatmaply)

heatmaply(mtcars) # <<<<<====CODE GETS STUCKS HERE. It just loads and loads, but does not complete itself.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/talgalili/heatmaply/issues/260#issuecomment-842626706, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHOJBR4XBZC3CMBJZKVIG3TOF6BFANCNFSM4Y646YJA .

talgalili avatar May 17 '21 20:05 talgalili

Hi there, I'm using a mac and using the free version of R studio R version 3.6.3 It's getting stuck with these 3 lines of code.

install.packages('heatmaply') library("heatmaply")

heatmaply(mtcars)

feteezuk avatar May 17 '21 20:05 feteezuk

I meant "which line of heatmaply hangs?"

CI passes so I don't really have a path to dig in further

alanocallaghan avatar May 17 '21 20:05 alanocallaghan

It's this line of code below which hangs:

heatmaply(mtcars)

feteezuk avatar May 17 '21 20:05 feteezuk

you could call debug(heatmaply) and then call heatmaply(mtcars) which will enter a debug session

you can then step through the function to identify which line hangs

alanocallaghan avatar May 17 '21 21:05 alanocallaghan

https://support.rstudio.com/hc/en-us/articles/205612627-Debugging-with-RStudio

alanocallaghan avatar May 17 '21 21:05 alanocallaghan

Hope this helps:

debug(heatmaply)
heatmaply(mtcars)
debugging in: heatmaply(mtcars)
debug: {
    UseMethod("heatmaply")
}
Browse[2]> {
+   UseMethod("heatmaply")
+ }
debug at #2: UseMethod("heatmaply")
Browse[3]>   UseMethod("heatmaply")
Error in UseMethod("heatmaply") : 
  'UseMethod' used in an inappropriate fashion
Browse[3]> 

feteezuk avatar May 17 '21 21:05 feteezuk

What's the output from

library(heatmaply) sessionInfo()

?

On Tue, May 18, 2021, 00:05 Jonathan H. @.***> wrote:

Hope this helps:

debug(heatmaply) heatmaply(mtcars) debugging in: heatmaply(mtcars) debug: { UseMethod("heatmaply") } Browse[2]> {

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/talgalili/heatmaply/issues/260#issuecomment-842638694, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHOJBVQ24FXF7QBVAEQ6X3TOGAKJANCNFSM4Y646YJA .

talgalili avatar May 17 '21 21:05 talgalili

  if (!missing(long_data)) {
    if (!missing(x)) {
      stop("x and long_data should not be used together")
    }
    assert_that(ncol(long_data) == 3, all(colnames(long_data) == 
      c("name", "variable", "value")))
    x <- reshape2::dcast(long_data, name ~ variable)
    rownames(x) <- x$name
    x$name <- NULL
  }

feteezuk avatar May 17 '21 21:05 feteezuk

sessionInfo()

Browse[2]> sessionInfo() R version 3.6.3 (2020-02-29) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS 10.16

Matrix products: default LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

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

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

other attached packages: [1] heatmaply_1.2.1 viridis_0.6.1 viridisLite_0.4.0 [4] plotly_4.9.3.9000 ggplot2_3.3.3

loaded via a namespace (and not attached): [1] pillar_1.6.1 compiler_3.6.3 RColorBrewer_1.1-2 [4] iterators_1.0.13 tools_3.6.3 dendextend_1.15.1 [7] digest_0.6.27 jsonlite_1.7.2 lifecycle_1.0.0
[10] tibble_3.1.1 gtable_0.3.0 pkgconfig_2.0.3
[13] rlang_0.4.11 foreach_1.5.1 rstudioapi_0.13
[16] cli_2.5.0 registry_0.5-1 DBI_1.1.1
[19] seriation_1.2-9 xfun_0.23 TSP_1.1-10
[22] gridExtra_2.3 withr_2.4.2 httr_1.4.2
[25] dplyr_1.0.6 generics_0.1.0 vctrs_0.3.8
[28] htmlwidgets_1.5.3 grid_3.6.3 webshot_0.5.2
[31] tidyselect_1.1.1 glue_1.4.2 data.table_1.13.6 [34] R6_2.5.0 fansi_0.4.2 tidyr_1.1.3
[37] purrr_0.3.4 magrittr_2.0.1 codetools_0.2-18
[40] scales_1.1.1 ellipsis_0.3.2 htmltools_0.5.1.1 [43] assertthat_0.2.1 colorspace_2.0-1 utf8_1.2.1
[46] tinytex_0.31 lazyeval_0.2.2 munsell_0.5.0
[49] crayon_1.4.1

feteezuk avatar May 17 '21 21:05 feteezuk

I did have the same issue after updating to R 4.1.0 under macOS 10.13.6, updating XQuartz, and doing brew upgrade at the same time. debug(heatmaply) froze at which pointed at base::capablities() as the culprit.

A simple log out should do the trick (XQuartz needs it to complete the installation) but to be on the safe side I also reinstalled all the packages that heatmaply requires from source (NB: I had to include manual references to gfortran in my ~/.R/Makevars build flags — without it Rcpp failed to build). Hope this helps.

memoryfull avatar May 31 '21 18:05 memoryfull