Problems with the function "insert_left"
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- r
- Domain
- data-visualization
Research direction
Start by reproducing the supplied heatmap and dendrogram example with aplot 0.2.0, then compare the same call with 0.1.8 and 0.1.9. Trace the insert_left entry point and the limit handling that produces the zero_range error; done means the example combines successfully without the coercion warning or missing-value error.
Written by the indexing model from the issue text.
Description
When using the aplot package (version 0.2.0), the following error message appears when using the function "insert_left":
Error in if (zero_range(as.numeric(limits))) { :
missing value where TRUE/FALSE needed
In addition: Warning message:
In zero_range(as.numeric(limits)) : NAs introduced by coercion
We have a matrix to plot heatmap like this:
And then we use the following code to generate the cluster tree:
dd <- dist(plotdata1, method = "euclidean")
hc <- hclust(dd, method = "ward.D2")
library(ggdendro)
pa=ggdendrogram(hc,theme_dendro = F)+
coord_flip()+
scale_y_reverse()+
theme_void()
Then the heatmap plot was plotted using the following code:
plotdata1 %>% ggplot(aes(x=condition,y=celltype))+
geom_tile(aes(fill = value),color = tile_color)+
scale_y_discrete(expand = c(0,0),position = "right")+
scale_x_discrete(expand = c(0,0))+
theme_bw()+
theme(
panel.grid = element_blank(),
axis.title = element_blank(),
axis.ticks.length = unit(0.15,"cm"),
axis.text.y.right = element_text(size = 12,colour = "black"),
axis.text.x.bottom = element_text(size = 12,colour = "black",angle = 0,hjust = 0.5)
)
And if I want to combine the two plot, Error was occured:
>insert_left(pb,pa,width = relative_width)
Error in if (zero_range(as.numeric(limits))) { :
missing value where TRUE/FALSE needed
In addition: Warning message:
In zero_range(as.numeric(limits)) : NAs introduced by coercion
However, aplot (version 0.1.8) works fine whereas vesion 0.1.9 and 0.2.0 can't. So maybe it's necessary to solve this problem in the next vesion.
- Dominant language
- R
- Stars
- 131
- Forks
- 17
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from YuLab-SMU/aplot
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Similar issues
-
documentation pkg infrastructure
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
epiverse-trace/epiparameter#511 ·
-
function:write_dwc
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Urgent request: Due to vulnerabilities move to API version 12.6.1 (12.6.2 eventually) or 13.1.1 Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
jbkunst/highcharter#849 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
r-lib/pkgdepends#485 · 3 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100