簡體   English   中英

R 維恩圖錯誤 - R 不打印我的維恩圖

[英]R Venn diagram error - R does not print my Venn Diagram

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. 問題是否在於 R 如何讀取我的代碼,因為 R 在我的代碼中沒有報告任何錯誤? 它只是不會在右側窗格中打印我的圖表。 我的代碼如下: ...

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

顯然, venn.diagram package 中的VennDiagram function 不會在您的繪圖設備上生成 plot。 而是將 plot 寫入您指定的文件中。 在您的工作目錄中,應該有一個名為“venn_diagram.png”的文件。

順便說一句,我無法重現您的示例,因為我沒有daily_activity數據集。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM