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

Heatmaply does not show plot #260

Open
bluejek128 opened this issue Mar 10, 2021 · 15 comments
Open

Heatmaply does not show plot #260

bluejek128 opened this issue Mar 10, 2021 · 15 comments
Labels

Comments

@bluejek128
Copy link

bluejek128 commented Mar 10, 2021

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 bluejek128 added the bug label Mar 10, 2021
@bluejek128
Copy link
Author

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

@feteezuk
Copy link

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

@alanocallaghan
Copy link
Collaborator

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. 2a75c62

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

@feteezuk
Copy link

#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.

@talgalili
Copy link
Owner

talgalili commented May 17, 2021 via email

@feteezuk
Copy link

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)

@alanocallaghan
Copy link
Collaborator

I meant "which line of heatmaply hangs?"

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

@feteezuk
Copy link

It's this line of code below which hangs:

heatmaply(mtcars)

@alanocallaghan
Copy link
Collaborator

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
Copy link
Collaborator

@feteezuk
Copy link

feteezuk commented May 17, 2021

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]> 

@talgalili
Copy link
Owner

talgalili commented May 17, 2021 via email

@feteezuk
Copy link

feteezuk commented May 17, 2021

  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
Copy link

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

@memoryfull
Copy link

memoryfull commented May 31, 2021

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.

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

No branches or pull requests

5 participants