r - Adding legend to venneuler -
i'd add legend venneuler ven diagram based upon generated colors in diagram. how can generate corresponding legend? possible plot values in ven?
list1 <- c("102","148","211","293","296","405") list2 <- c("102","148") lists <- list(list1,list2) items <- sort(unique(unlist(lists))) mat <- matrix(rep(0,length(items)*length(lists)), ncol=3) colnames(mat) <- c("a","b") rownames(mat) <- items lapply(seq_along(lists), function(i){ mat[items %in% lists[[i]],i] <<- table(lists[[i]]) }) mat library(venneuler) v <- venneuler(mat > 0) plot(v,main='r simple plot')
Comments
Post a Comment