R Venn diagram error - R does not print my Venn Diagram

904 Views Asked by At

I installed the VennDiagram package in R and used the following code to draw a Venn Diagram, however when I run the code, I do not get the plot, but only the output of [1] in the console. Does the problem lie in how R reads my code, as R does not report any error in my code? It just does not print my chart in the pane on the right-hand side. My code is as follows: ...

activity_ids <- unique(daily_activity$id, incomparables = FALSE)
sleep_ids <- unique(sleep_day$id, incomparables = FALSE)
steps_ids <- unique(hourly_activity$id, incomparables = FALSE)
heartrate_ids <- unique(heart_rate$id, incomparables = FALSE)

venn.diagram (x = list(activity_ids, sleep_ids, steps_ids, heartrate_ids),
         category.names = c("Activity", "Sleep", "Steps", "Heartrate"),
         filename= "venn_diagram.png",
         output=TRUE, imagetype = "png",
  lwd = 2, fill = c("orange", "red", "green", "blue"),
  cex = 2, fontface = "bold", fontfamily = "sans",
  cat.col = c("orange", "red", "green", "blue"), cat.cex = 2, cat.default.pos = "outer")
1

There are 1 best solutions below

3
On BEST ANSWER

Apparantly, the venn.diagram function in the VennDiagram package does not produce a plot on your plotting device (the "Plots" tab in RStudio). Instead, the plot gets written into the file you specified. In your working directory, there should be a file named "venn_diagram.png".

BTW, I could not reproduce your example, since I don't have the daily_activity dataset.