Coder Social home page Coder Social logo

eheat's People

Contributors

yunuuuu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

eheat's Issues

Error on example data

This package looks like exactly what I need but I was not able to reproduce the example. Thanks for any help you can give!

> set.seed(123)
> nr1 <- 4
> nr2 <- 8
> nr3 <- 6
> nr <- nr1 + nr2 + nr3
> nc1 <- 6
> nc2 <- 8
> nc3 <- 10
> nc <- nc1 + nc2 + nc3
> mat <- cbind(
+     rbind(
+         matrix(rnorm(nr1 * nc1, mean = 1, sd = 0.5), nrow = nr1),
+         matrix(rnorm(nr2 * nc1, mean = 0, sd = 0.5), nrow = nr2),
+         matrix(rnorm(nr3 * nc1, mean = 0, sd = 0.5), nrow = nr3)
+     ),
+     rbind(
+         matrix(rnorm(nr1 * nc2, mean = 0, sd = 0.5), nrow = nr1),
+         matrix(rnorm(nr2 * nc2, mean = 1, sd = 0.5), nrow = nr2),
+         matrix(rnorm(nr3 * nc2, mean = 0, sd = 0.5), nrow = nr3)
+     ),
+     rbind(
+         matrix(rnorm(nr1 * nc3, mean = 0.5, sd = 0.5), nrow = nr1),
+         matrix(rnorm(nr2 * nc3, mean = 0.5, sd = 0.5), nrow = nr2),
+         matrix(rnorm(nr3 * nc3, mean = 1, sd = 0.5), nrow = nr3)
+     )
+ )
> mat <- mat[sample(nr, nr), sample(nc, nc)] # random shuffle rows and columns
> rownames(mat) <- paste0("row", seq_len(nr))
> colnames(mat) <- paste0("column", seq_len(nc))
> small_mat <- mat[1:9, 1:9]
> draw(ggheat(small_mat))
Error in `gtable_trim()` at gtable/R/filter.R:42:3:
! `x` must be a gtable object, not a <zeroGrob/grob/gDesc> object.
Run `rlang::last_trace()` to see where the error occurred.

Patchwork compatibility

Is there a way to make heatmaps drawn with these objects compatible with patchwork? I tried below but got an error. Thank you

> g1 <- ggheat(small_mat, height = unit(2,'in'), width = unit(2,'in'))
> p1 <- ggplot(mtcars) + geom_point(aes(mpg, disp))
> 
> g1 + p1
Error in g1 + p1 : non-numeric argument to binary operator
In addition: Warning message:
Incompatible methods ("+.AdditiveUnit", "+.gg") for "+" 
> sessionInfo()
R version 4.4.0 (2024-04-24)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 20.04.6 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3;  LAPACK version 3.9.0

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

time zone: America/Los_Angeles
tzcode source: system (glibc)

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

other attached packages:
[1] patchwork_1.2.0       dplyr_1.1.4           progress_1.2.3        eheat_0.0.0.9000      ggplot2_3.5.1         ComplexHeatmap_2.15.4

loaded via a namespace (and not attached):
 [1] utf8_1.2.4          generics_0.1.3      tidyr_1.3.1         renv_1.0.7          shape_1.4.6.1       hms_1.1.3           digest_0.6.35       magrittr_2.0.3     
 [9] RColorBrewer_1.1-3  iterators_1.0.14    circlize_0.4.16     foreach_1.5.2       doParallel_1.0.17   GlobalOptions_0.1.2 purrr_1.0.2         fansi_1.0.6        
[17] scales_1.3.0        codetools_0.2-19    textshaping_0.4.0   cli_3.6.2           rlang_1.1.4         crayon_1.5.2        munsell_0.5.1       withr_3.0.0        
[25] tools_4.4.0         parallel_4.4.0      colorspace_2.1-0    GetoptLong_1.0.5    BiocGenerics_0.50.0 vctrs_0.6.5         R6_2.5.1            png_0.1-8          
[33] matrixStats_1.3.0   stats4_4.4.0        lifecycle_1.0.4     S4Vectors_0.42.0    IRanges_2.38.0      clue_0.3-65         ragg_1.3.2          cluster_2.1.6      
[41] pkgconfig_2.0.3     pillar_1.9.0        gtable_0.3.5        glue_1.7.0          systemfonts_1.1.0   tibble_3.2.1        tidyselect_1.2.1    rstudioapi_0.16.0  
[49] farver_2.1.2        rjson_0.2.21        labeling_0.4.3      Cairo_1.6-2         compiler_4.4.0      prettyunits_1.2.0  

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.