I am trying to plot a volcanoplot but I get this error:
Error in grid.Call(C_convert, x, as.integer(whatfrom), as.integer(whatto), :
Viewport has zero dimension(s)
I've never had this probelm, the code used to work just fine. It's basically a volcanoplot of cells according to labels. I'm trying to see the difference between two groups.
p=c()
for (i in 1:nrow(scores.batch)){
p[i] = wilcox.test(scores.batch[i,totaldata$Response=='Response'],scores.batch[i,totaldata$Response=='NoResponse'])$p.value
}
p.adj = p.adjust(p,method='fdr')
lfc = log2(rowMeans(scores.batch[,totaldata$Response=='Response'])/rowMeans(scores.batch[,totaldata$Response=='NoResponse']))
set.seed(42)
DF.2 = data.frame(lfc, p, labels= rownames(scores.batch))
EnhancedVolcano(toptable = DF.2, lab=DF.2$labels, drawConnectors = TRUE,
x='lfc',y='p',pCutoff = 0.5, FCcutoff = 0.25, ylim = c(0,7.5), xlim = c(-1.5,1.5))
What could cause this? I tried restarting R but it didn't help.
CodePudding user response:
This error occurs when the viewer window is too small - try increasing its size to stop the error.