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

Problems with the function "insert_left" #35

Open
lisch7 opened this issue Aug 27, 2023 · 0 comments
Open

Problems with the function "insert_left" #35

lisch7 opened this issue Aug 27, 2023 · 0 comments

Comments

@lisch7
Copy link

lisch7 commented Aug 27, 2023

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:

image

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()
image

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)
    )
image

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.

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

No branches or pull requests

1 participant