jmw86069 / venndir

Venn diagrams with directionality (concordance), optional display of items inside the figure, text Venn diagrams
https://jmw86069.github.io/venndir
Other
6 stars 0 forks source link

could not find function "tcount" #2

Closed ryao-mdanderson closed 2 years ago

ryao-mdanderson commented 2 years ago

Hello,

I followed the installation instruction and test as in the README, I hit an error, please advise, thank you!

library(venndir) setlist <- make_venn_test(100, 3) venndir(setlist) Error in tcount(sign(diff(h1h2df1$h2))) : could not find function "tcount" setlist $set_A [1] "item_067" "item_042" "item_050" "item_043" "item_014" "item_025" [7] "item_090" "item_091" "item_069" "item_093" "item_057" "item_009" [13] "item_072" "item_026" "item_007" "item_099" "item_089" "item_083" [19] "item_036" "item_078" "item_097" "item_076" "item_015" "item_032" [25] "item_086" "item_084" "item_041" "item_023" "item_027" "item_060" [31] "item_053" "item_079"

$set_B [1] "item_053" "item_027" "item_096" "item_038" "item_089" "item_034" [7] "item_093" "item_069" "item_072" "item_076" "item_063" "item_013" [13] "item_082" "item_025" "item_097" "item_021"

$set_C [1] "item_079" "item_041" "item_047" "item_090" "item_060" "item_095" [7] "item_016" "item_006" "item_072" "item_086" "item_091" "item_039" [13] "item_031" "item_081" "item_050"

venndir(setlist) Error in tcount(sign(diff(h1h2df1$h2))) : could not find function "tcount" sessionInfo() R version 4.1.0 (2021-05-18) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Red Hat Enterprise Linux

Matrix products: default BLAS/LAPACK: /usr/lib64/libopenblas-r0.3.3.so

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

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

other attached packages: [1] venndir_0.0.17.9000 remotes_2.4.0

loaded via a namespace (and not attached): [1] lattice_0.20-44 ps_1.6.0 prettyunits_1.1.1
[4] crayon_1.4.1 withr_2.4.2 rprojroot_2.0.2
[7] grid_4.1.0 R6_2.5.0 cli_3.0.0
[10] curl_4.3.2 data.table_1.14.0 rstudioapi_0.13
[13] sp_1.4-5 callr_3.7.0 jamba_0.0.70.900
[16] tools_4.1.0 colorjam_0.0.22.900 compiler_4.1.0
[19] processx_3.5.2 pkgbuild_1.2.0

ryao-mdanderson commented 2 years ago

@jmw86069 May you please help? Thanks!

jmw86069 commented 2 years ago

Thank you for reporting the issue, I have a quick workaround while I fix the underlying issue.

The tcount() function is provided by the jamba package, the fastest workaround is to load jamba first, then venndir will work properly:

library(jamba)
library(venndir)
venndir(...)

I need to update the colorjam package that is calling tcount() in this case, and will do so shortly. Apologies for not seeing your post sooner!

jmw86069 commented 2 years ago

Okay I have updated colorjam to use package prefix jamba::tcount(), bumped the version number. I then updated venndir to require the appropriate colorjam version. So in principle you can update venndir and see the fix.

remotes::install_github("jmw86069/venndir")

Honestly, this is a weird bug to me! I guess I'm glad to learn about it and avoid it in future.

Internally, colorjam::approx_degrees() was trying to call jamba::tcount(). (I use approx_degrees() to adjust the red-green-blue color wheel to a more dichromat-colorblindness-friendly color wheel, which is then used to define colorblindness-friendly categorical colors. approx_degrees() is like approx() for interpolation of angular degrees.)

Thank you for posting the error, and I apologize that I did not catch it previously.

Let me know if you have questions or feedback about venndir! I'm interested to make it useful for other people's analysis work!

ryao-mdanderson commented 2 years ago

Hello James: Thank you very much for your reply and fixes. This is a scientist in my institution asks for my help to debug with the package. I am glad to seek help from you. We will definitely try your fix version.

I appreciate.

Rong

ryao-mdanderson commented 2 years ago

@jmw86069 I am glad it works now. Thank you.

jmw86069 commented 2 years ago

Great, thank you for the feedback! And if you or the scientists at your institution have questions, feel to ask, I'm happy to help!