YuLab-SMU / ggtree

:christmas_tree:Visualization and annotation of phylogenetic trees
https://yulab-smu.top/contribution-tree-data/
838 stars 173 forks source link

rect_to_poly issue #601

Open GuangchuangYu opened 8 months ago

GuangchuangYu commented 8 months ago

rect_to_polygeom_hilight中有使用,https://github.com/YuLab-SMU/ggtree/blob/devel/R/geom_hilight.R#L200,然而这个函数有问题,而且已经被ggplot2移除了,https://github.com/tidyverse/ggplot2/pull/5081.

所以我们也需要对接一下,参考ggplot2中新的实现,因为老的实现如果直接搬过来的话,那问题依然存在,在使用极坐标时,形状有点问题。

GuangchuangYu commented 7 months ago

先copy这段代码,让ggtree兼容新版ggplot2. 后面再相应更新。

James-Kitson commented 6 months ago

I'm currently having issues installing ggtree with the error:

Error in get(x, envir = ns, inherits = FALSE) : object 'rect_to_poly' not found

Is my issue also linked to the changes to ggplot2?

I'm on R version 4.3.0 and ggplot2 3.5.0

Thanks!

AlexLOTR commented 6 months ago

I'm currently having issues installing ggtree with the error:

Error in get(x, envir = ns, inherits = FALSE) : object 'rect_to_poly' not found

Is my issue also linked to the changes to ggplot2?

I'm on R version 4.3.0 and ggplot2 3.5.0

Running into the same error when installing ggtree package: Error in get(x, envir = ns, inherits = FALSE) : object 'rect_to_poly' not found Error: unable to load R code in package ‘ggtree’ Execution halted ERROR: lazy loading failed for package ‘ggtree’

quote: 先copy这段代码,让ggtree兼容新版ggplot2. 后面再相应更新。 where should i copy these codes into?

AlexLOTR commented 6 months ago

I'm currently having issues installing ggtree with the error: Error in get(x, envir = ns, inherits = FALSE) : object 'rect_to_poly' not found Is my issue also linked to the changes to ggplot2? I'm on R version 4.3.0 and ggplot2 3.5.0

Running into the same error when installing ggtree package: Error in get(x, envir = ns, inherits = FALSE) : object 'rect_to_poly' not found Error: unable to load R code in package ‘ggtree’ Execution halted ERROR: lazy loading failed for package ‘ggtree’

* removing ‘/usr/local/lib/R/site-library/ggtree’

quote: 先copy这段代码,让ggtree兼容新版ggplot2. 后面再相应更新。 where should i copy these codes into?

I found a solution guys! After upgrading the BiocManager to ver 3.18, I can install the ggtree and enrichplot packages normally:

BiocManager::install(version = "3.18") library("BiocManager") Bioconductor version 3.18 (BiocManager 1.30.22), R 4.3.1 (2023-06-16) BiocManager::install("ggtree") library("ggtree") ggtree v3.10.1 For help: https://yulab-smu.top/treedata-book/

James-Kitson commented 6 months ago

This seems to work for me! Thanks

AmelZulji commented 4 months ago

I have the same problem:

Error in get(x, envir = ns, inherits = FALSE) : 
  object 'rect_to_poly' not found
Error: unable to load R code in package ‘ggtree’
Execution halted
ERROR: lazy loading failed for package ‘ggtree’

I am on RHEL HPC and have bioconductor version 3.16 which i cant upgrade.

Can you please help

Regards, Amel

GuangchuangYu commented 4 months ago

@AmelZulji Upgrade ggtree or downgrade ggplot2.

AmelZulji commented 4 months ago

Thank you for the quick replay, Yu! The version of ggtree which is failing is the newest one 3.6.2.

I will try donwgrading ggplot2. Do you know which version of ggplot2 would be compatible perhaps <3.5.0 ?

GuangchuangYu commented 4 months ago

Thank you for the quick replay, Yu! The version of ggtree which is failing is the newest one 3.6.2.

I will try donwgrading ggplot2. Do you know which version of ggplot2 would be compatible perhaps <3.5.0 ?

yes, ggplot2 v<3.5.0 should be fine.

vzsmitj commented 1 month ago

Hi I am having the same issue where I get the error as follows:

Error in get(x, envir = ns, inherits = FALSE) : object 'rect_to_poly' not found Error: unable to load R code in package ‘ggtree’ Execution halted ERROR: lazy loading failed for package ‘ggtree’

I am using R version 4.3 and Bioconductor version 3.18.

I tried downgrading ggplot2 to version 3.4.9 and then install but the same error message came up.

Do you have any advice to solve?

Thanks