Cenn: diagram. Error in as.unit(e2) : object is not coercible to a unit

I having trouble getting out of this error. I did not encounter this error until after I erroneously updated R version.

A screenshot of the object, genes_per_dataset, to be used to develop the Venn diagram is attached
Here is the script:

venn::venn( genes_per_dataset, opacity = .3, zcolor = "grey50", cexsn = 0, cexil = 1, lwd = 2, col = "black", frame = T, borders = F, ggplot = F, ellipse = F, ilcs = 1, box = F, snames = c("Rep 1", "Rep 2"), ilabels = F, margin(0) )

Any help please. Thanks.

Can you run more minimal examples? For example, do these work?

From the examples

venn::venn(3)

with a similar dataset structure as yours

genes_per_dataset <- list(
  paste0("gene_", 1:10),
  paste0("gene_", 5:15)
)

venn::venn(genes_per_dataset)

or to check your dataset on a different package (requires installing the {eulerr} package):

genes_per_dataset |>
  setNames(c("Rep1", "Rep2")) |>
  eulerr::venn() |>
  plot()

Thank you the second eulerr worked.

How do I have the plot appear in the plot appear in the 'plots' area in rStudio and save it as in a folder as a pdf, png or jpeg? As not the plot appears outside the plot area and affects other subsequent plots that initially were appearing in the 'plot' area in rStudio.
Thanks.

Weird, for me it both venn and eulerr plots appear in the plot area.

Try first running dev.off() (multiple times if needed, until the return value is null device), then if you do plot(1), does it correctly gets plotted in the RStudio plot area? Then if you run the reprex above, does it create a separate window?

I tried this, it does still not plot in the rStudio plot area.

Even plot(1)? You do manage to close all graphical devices, right?

Maybe you can start a new thread; because it's a different problem, you might get other people's attention.