-2

I try to create a Venn Diagram with venn() function in R. It works but I want to be able to define my own labels instead of "A", "B" e.t.c... I don't understand how one do that cause there is no label argument that can be passed to the function.

EDIT: Forgot to say that I use a list of vectors which contain strings...

*EDIT2:

it is the package "venn" from gplots:

library(gplots)

Example code:

variable list_ looks like this:

> list_
[[1]]
[1] "hejsan"   "pelle"    "svanslov"

[[2]]
[1] "kok"   "nalle" "pelle"

and then I do:

venn(list_)

which looks like this:

http://postimage.org/image/wpis8ny2b/deea76ff/

Bebe
  • 347
  • 1
  • 5
  • 10
  • 2
    Could you post the code you use? Even though it doesn't do exactly what you want it to, it is much easier to help you if we know what you are doing, what packages you use and so on. – Backlin Aug 22 '12 at 14:05

2 Answers2

1

The venn function takes the labels in the plot from the names of the list elements.

names(list_) <- c("First list", "Second list")
venn(list_)
Backlin
  • 14,612
  • 2
  • 49
  • 81
0

I couldn't find the venn() function that you are using. If you're willing to use a different package there is a short tutorial here -> http://www.ats.ucla.edu/stat/r/faq/venn.htm that will let you do what you want with the "names" argument.

James Elderfield
  • 2,389
  • 1
  • 34
  • 39