[Vennerable-commits] r60 - in pkg/Vennerable: R inst/doc man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Sep 25 20:08:16 CEST 2009


Author: js229
Date: 2009-09-25 20:08:14 +0200 (Fri, 25 Sep 2009)
New Revision: 60

Added:
   pkg/Vennerable/man/PlotVennGeometry.Rd
   pkg/Vennerable/man/VennSetSetLabels.Rd
Modified:
   pkg/Vennerable/R/03VennDrawing.R
   pkg/Vennerable/inst/doc/Venn.Rnw
   pkg/Vennerable/man/TissueDrawing-class.Rd
   pkg/Vennerable/man/VennThemes.Rd
   pkg/Vennerable/man/Vennerable-internal.Rd
   pkg/Vennerable/man/compute.Venn.Rd
Log:
documentation updates plus universe accessor

Modified: pkg/Vennerable/R/03VennDrawing.R
===================================================================
--- pkg/Vennerable/R/03VennDrawing.R	2009-09-23 23:10:53 UTC (rev 59)
+++ pkg/Vennerable/R/03VennDrawing.R	2009-09-25 18:08:14 UTC (rev 60)
@@ -17,7 +17,8 @@
 setGeneric("Areas",function(object){standardGeneric("Areas")}) 
 setGeneric("ComputeAreas",function(object,nintervals){standardGeneric("ComputeAreas")}) 
 setGeneric("VisibleRange",function(object){standardGeneric("VisibleRange")}) 
-setGeneric("UniverseRange",function(object){standardGeneric("UniverseRange")}) 
+setGeneric("VennGetUniverseRange",function(object){standardGeneric("VennGetUniverseRange")}) 
+setGeneric("VennSetUniverseRange",function(object,universe){standardGeneric("VennSetUniverseRange")}) 
 setGeneric("VennSetSetLabels",function(object,SetLabels){standardGeneric("VennSetSetLabels")}) 
 setGeneric("VennGetSetLabels",function(object){standardGeneric("VennGetSetLabels")}) 
 setGeneric("VennSetFaceLabels",function(object,FaceLabels){standardGeneric("VennSetFaceLabels")}) 
@@ -34,8 +35,8 @@
 	invisible(	object)
 })
 
-setMethod("UniverseRange","VennDrawing",function(object)object at universe)
-# eg CircleDrawing overrides these methods:
+setMethod("VennGetUniverseRange","VennDrawing",function(object)object at universe)
+setMethod("VennSetUniverseRange","VennDrawing",function(object,universe){object at universe<-universe;object})
 setMethod("VisibleRange","TissueDrawing",function(object){
 	dxxy <- do.call("rbind",lapply(names(object at setList),.face.toxy,type="set",drawing=object))
 	apply(dxxy,2,range)
@@ -61,7 +62,7 @@
 
 setMethod("PlotUniverse","VennDrawing", function(object,gp) {
 	if(missing(gp)) { gp <- NULL }
-	uv <- UniverseRange(object)
+	uv <- VennGetUniverseRange(object)
 	grid.rect(x=mean(uv[,1]),y=mean(uv[,2]),
 		width=diff(uv[,1]),height=diff(uv[,2]),default.unit="native",gp=gp)
 	}
@@ -93,8 +94,8 @@
 
 
 CreateViewport <- function(object) {
-	xData <- UniverseRange(object)[,1]
-	yData <- UniverseRange(object)[,2]
+	xData <- VennGetUniverseRange(object)[,1]
+	yData <- VennGetUniverseRange(object)[,2]
 	makevp.eqsc(xData,yData)
 }
 
@@ -104,7 +105,7 @@
 	upViewport()
 }
 
-VennThemes<- function(drawing,colourAlgorithm) {
+VennThemes<- function(drawing,colourAlgorithm,increasingLineWidth) {
 	gpList <- list()
 	if (is.null(gpList[["Face"]])) {
 		gpList[["Face"]]<- FaceColours(drawing=drawing,colourAlgorithm=colourAlgorithm)
@@ -113,7 +114,7 @@
 		gpList[["FaceText"]] <- FaceTextColours(drawing=drawing,colourAlgorithm=colourAlgorithm)
 	}
 	if (is.null(gpList[["Set"]])) {
-		gpList[["Set"]] <- SetColours(drawing=drawing,colourAlgorithm=colourAlgorithm)
+		gpList[["Set"]] <- SetColours(drawing=drawing,colourAlgorithm=colourAlgorithm,increasingLineWidth)
 	}
 	if (is.null(gpList[["SetText"]])) {
 		gpList[["SetText"]] <- SetTextColours(drawing=drawing)
@@ -199,8 +200,9 @@
 
 
 
-SetColours <- function(drawing,colourAlgorithm) {
+SetColours <- function(drawing,colourAlgorithm,increasingLineWidth) {
 	if (missing(colourAlgorithm)) { colourAlgorithm <- "sequential"}
+	if (missing(increasingLineWidth)) { increasingLineWidth <- FALSE}
 	nSets <-length(drawing at setList)
 	if (colourAlgorithm=="binary") {
 		setcolours <-rep("blue",nSets)
@@ -213,9 +215,12 @@
  		setcolours <-fillcols[1:nSets]; 
 		names(setcolours) <- names(drawing at setList)
 	}
-	gp <- lapply(names(setcolours ),function(x)gpar(col=setcolours [[x]],fill=NA,lty=1,lwd=3)); 	
-	names(gp) <- names(setcolours)
-	gp
+	gpList <- lapply(names(setcolours ),function(x)gpar(col=setcolours [[x]],fill=NA,lty=1,lwd=3)); 	
+	if (increasingLineWidth) {
+		gpList <- lapply(1:nSets,function(x){gp <- gpList[[x]];gp$lwd <- nSets - x + 1; gp})
+	}
+	names(gpList ) <- names(setcolours)
+	gpList 
 }
 
 
@@ -368,7 +373,7 @@
 	}
 
 PlotDarkMatter <- function(VD) {
-	ur <- UniverseRange(VD)
+	ur <- VennGetUniverseRange(VD)
 	grey <- brewer.pal(8,"Greys")[2]
 	grid.polygon(x=ur[c(1,1,2,2),1],y=ur[c(1,2,2,1),2],gp=gpar(fill=grey))
 	.PlotFace.TissueDrawing(VD,"DarkMatter",gp=gpar(fill="white"),doDarkMatter=TRUE)

Modified: pkg/Vennerable/inst/doc/Venn.Rnw
===================================================================
--- pkg/Vennerable/inst/doc/Venn.Rnw	2009-09-23 23:10:53 UTC (rev 59)
+++ pkg/Vennerable/inst/doc/Venn.Rnw	2009-09-25 18:08:14 UTC (rev 60)
@@ -52,7 +52,7 @@
 
 V4 <- Venn(n=4)
 plot(V4,type="ellipses",doWeights=FALSE,
-	show=list(universe=FALSE,FaceText="",SetLabels=FALSE,Faces=FALSE))
+	show=list(Universe=FALSE,FaceText="",SetLabels=FALSE,Faces=FALSE))
 @
 \end{center}
 \newpage
@@ -124,44 +124,6 @@
 of corresponding set elements. Finally it adds a number of
 graphical control abilities, including the ability to colour individual
 regions separately.
-\newpage
-\section{Some loose definitions}
-Figure \ref{fig:canonical} illustrates membership of three sets,
-in order OCT4, SOX2 , NANOG. 
-Genes which are members of the SOX2 set but not the OCT4 or NANOG sets
-are members of an \emph{intersection subset} with \emph{indicator string} or \emph{signature}
-\texttt{010}.
-
-Given $n$ sets of elements drawn from a universe,
- there are $2^n$ {intersection subsets}. Each of these is 
-a subset of the universe and there
-is one corresponding to each of the binary strings of length $n$.
-If one of these indicator strings has a 1 in the $i$-th position, all of members of the 
-corresponding intersection subset must be members of the $i$-th set. Depending on the application, the 
-universe of elements from which members of the sets are drawn 
-may be important. 
-Elements in intersection set \texttt{00\ldots}, which are in 
-the universe but not in any known set, are called (by me) \emph{dark matter},
-and we tend to display these differently.
-
-A diagram which produces a visualisation of each of the sets
-as a connected curve in the plane whose regions of intersection
-are connected and correspond to each of the $2^n$ intersection subsets
-is an \emph{unweighted Venn diagram}.
-Weights can be assigned to each of the intersections,
-most naturally being proportional to the number of elements each one contains.
-\emph{Weighted Venn diagrams} have the same topology as unweighted ones, but 
-(attempt to) make the area of each region proportional to the weights. 
-This may not be possible, if any of the weights are zero for example, or because 
-of the geometric constraints of the diagram. Venn diagrams based on 3 circles
-are unable in general to represent even nonzero weights exactly, and cannot be constructed
-at all for $n>3$.
-
-Diagrams in which only those intersections with non-zero weight appear are \emph{Euler diagrams},
-and diagrams which go further and make the area of every intersection proportional to its weight are weighted Euler diagrams.
-For more details and rather more rigour see first the online review of Ruskey and Weston\cite{ruskeyweston:2005} and then the references it contains.
-
-\newpage
 \section{Computation and Annotation}
 \subsection{Computing Venn drawings}
 The calls to \texttt{plot} are really convenience wrappers for two separate functions which compute the 
@@ -204,17 +166,12 @@
 complexity of the diagram. This can be overridden with the \texttt{gpList} argument
 to \texttt{plot}. The default choices are equivalent to 
 <<eval=FALSE,echo=TRUE>>=
-gp <- VennThemes(C3)
-plot(C3,gpList=gp)
+gpList <- VennThemes(C3)
+plot(C3,gpList=gpList)
 @
-The only available high-level modification is that \texttt{VennThemes} can take the \texttt{ColourAlgorithm} style - see the man page for more details.
-Low-level modifications can be made by modifiying the \texttt{gp} argument itself. That must
-be a named list, with elements that can include \texttt{Face},
-\texttt{FaceText},
-\texttt{Set}, and \texttt{SetText}.
-Each of those elements is itself a named list named by either the name of the set or the signature of the face. 
-The elements of these lists in turn are graphical parameters in the sense of
- the \texttt{grid} package, essentially lists of parameter-value pairs.
+Low-level modifications can be using the \texttt{gpList} argument, typically by modifying the value of a call to \texttt{VennThemes}.
+There is more detail on the \texttt{VennThemes} man page about the format of \texttt{gpList}.
+More high-level modifications can be made by supplying the \texttt{ColourAlgorithm} or \texttt{increasingLineWidth} arguments to \texttt{VennThemes}.
 
 \begin{figure}[H]\begin{center}
 <<pwabVmonth3,echo=TRUE,fig=TRUE>>=
@@ -226,7 +183,22 @@
 \label{fig:canonicalb}
 \end{center}\end{figure}
 
+The position and format of the set and face annotation are controlled by the data returned by \texttt{VennGetSetLabels} and \texttt{VennGetFaceLabels},
+respectively, which can be modified and then reembedded in the \code{VennDrawing} object with \texttt{VennSetSetLabels} and \texttt{VennSetFaceLabels}.
 
+
+\begin{figure}[H]\begin{center}
+<<pwabVmonth3,echo=TRUE,fig=TRUE>>=
+grid.newpage()
+SetLabels <- VennGetSetLabels(C3)
+SetLabels[SetLabels$Label=="February","y"] <- SetLabels[SetLabels$Label=="March","y"]
+C3 <- VennSetSetLabels(C3,SetLabels)
+plot(C3)
+@
+\caption{Modifying the position of annotation} 
+\label{fig:canonicald}
+\end{center}\end{figure}
+
 \newpage
 \section{Unweighted Venn diagrams}
 
@@ -471,11 +443,15 @@
 <<S47fig,fig=TRUE,cache=TRUE,eval=TRUE>>=
 doans <- function(n) {
 	S4  <- compute.AWFE(Venn(n=n),type="AWFE")
+	if (n==1) { # borrow the universe from the larger picture
+		S5 <- compute.AWFE(Venn(n=2),type="AWFE")
+		S4 <- VennSetUniverseRange(S4,VennGetUniverseRange(S5)
+	}
 	gp <- VennThemes(drawing=S4,colourAlgorithm="binary")
 	plot(S4,gpList=gp,show=list(FaceText="",Faces=TRUE,SetLabels=FALSE,Sets=FALSE))
 }
 grid.newpage()
-pushViewport( viewport(layout=grid.layout(4,2)))
+pushViewport( viewport(layout=grid.layout(3,2)))
 pushViewport(viewport(layout.pos.row=1,layout.pos.col=1))
 doans(1)
 upViewport()
@@ -494,13 +470,14 @@
 pushViewport(viewport(layout.pos.row=3,layout.pos.col=2))
 doans(6)
 upViewport()
+if (FALSE) {
 pushViewport(viewport(layout.pos.row=4,layout.pos.col=1))
 doans(7)
 upViewport()
 pushViewport(viewport(layout.pos.row=4,layout.pos.col=2))
 doans(8)
 upViewport()
-
+}
 @
 \caption{Edwards constructions for five to eight sets}
 \end{center}\end{figure}
@@ -512,7 +489,7 @@
 
 
 \begin{figure}[H]\begin{center}
-<<S47battle,fig=TRUE,echo=TRUE,eval=TRUE>>=
+<<S47battle,fig=TRUE,echo=TRUE,eval=FALSE>>=
 plot(Venn(n=9),type="battle",show=list(SetLabels=FALSE,FaceText=""))
 @
 \caption{The battlement variant of the Edwards construction on 9 sets with the \texttt{type=battle} argument}
@@ -669,12 +646,9 @@
 
 
 \begin{figure}[H]\begin{center}
-<<plotCR4stem,echo=TRUE,fig=TRUE,cache=TRUE>>=
+<<plotCR4stem,echo=FALSE,fig=TRUE,cache=TRUE>>=
 Tstem <- compute.Venn(Vstem)
-gp <- VennThemes(Tstem,colourAlgorithm="sequential")
-gps <- gp[["Set"]]; nSets <- length(gps)
-for (ix in 1:nSets) { gps[[ix]]$lwd <- nSets+1 - ix }
-gp[["Set"]] <- gps
+gp <- VennThemes(Tstem,colourAlgorithm="sequential",increasingLineWidth=TRUE)
 plot(Vstem,type="ChowRuskey",show=list(SetLabels=TRUE),gp=gp)
 @
 \caption{Chow-Ruskey weighted 4-set diagram for the stem cell data}
@@ -897,12 +871,52 @@
 V4z <-  VennFromSets( setList[1:4])
 CK4z <- compute.CR(V4z)
 grid.newpage()
-plot(CK4z,show=list(SetLabels=FALSE,FaceText="elements",Faces=TRUE))
+gp <- VennThemes(CK4z,increasingLineWidth=TRUE)
+plot(CK4z,show=list(SetLabels=FALSE,FaceText="elements",Faces=TRUE),gpList=gp)
 @
 \caption{Chow-Ruskey diagram with some zero weights}
 \end{center}\end{figure}
 
+\newpage
+\section{Some loose definitions}
+Figure \ref{fig:canonical} illustrates membership of three sets,
+in order OCT4, SOX2 , NANOG. 
+Genes which are members of the SOX2 set but not the OCT4 or NANOG sets
+are members of an \emph{intersection subset} with \emph{indicator string} or \emph{signature}
+\texttt{010}.
 
+Given $n$ sets of elements drawn from a universe,
+ there are $2^n$ {intersection subsets}. Each of these is 
+a subset of the universe and there
+is one corresponding to each of the binary strings of length $n$.
+If one of these indicator strings has a 1 in the $i$-th position, all of members of the 
+corresponding intersection subset must be members of the $i$-th set. Depending on the application, the 
+universe of elements from which members of the sets are drawn 
+may be important. 
+Elements in intersection set \texttt{00\ldots}, which are in 
+the universe but not in any known set, are called (by me) \emph{dark matter},
+and we tend to display these differently.
+
+A diagram which produces a visualisation of each of the sets
+as a connected curve in the plane whose regions of intersection
+are connected and correspond to each of the $2^n$ intersection subsets
+is an \emph{unweighted Venn diagram}.
+Weights can be assigned to each of the intersections,
+most naturally being proportional to the number of elements each one contains.
+\emph{Weighted Venn diagrams} have the same topology as unweighted ones, but 
+(attempt to) make the area of each region proportional to the weights. 
+This may not be possible, if any of the weights are zero for example, or because 
+of the geometric constraints of the diagram. Venn diagrams based on 3 circles
+are unable in general to represent even nonzero weights exactly, and cannot be constructed
+at all for $n>3$.
+
+Diagrams in which only those intersections with non-zero weight appear are \emph{Euler diagrams},
+and diagrams which go further and make the area of every intersection proportional to its weight are weighted Euler diagrams.
+For more details and rather more rigour see first the online review of Ruskey and Weston~\cite{ruskeyweston:2005} and then the references it contains.
+
+\newpage
+
+
 \section{This document}
 
 \begin{tabular}{|l|l|}

Added: pkg/Vennerable/man/PlotVennGeometry.Rd
===================================================================
--- pkg/Vennerable/man/PlotVennGeometry.Rd	                        (rev 0)
+++ pkg/Vennerable/man/PlotVennGeometry.Rd	2009-09-25 18:08:14 UTC (rev 60)
@@ -0,0 +1,47 @@
+\name{PlotVennGeometry}
+\Rdversion{1.1}
+\alias{PlotVennGeometry}
+\title{
+Display computed Venn diagrams
+}
+\description{
+This is the function called by the \code{plot} generic for objects of class \code{VennDrawing}.
+}
+\usage{
+PlotVennGeometry(C3, gpList, show = list(FaceText = "weight"))
+}
+\arguments{
+  \item{C3}{
+An object of class \code{VennDrawing}, as produced by \code{compute.Venn}
+}
+  \item{gpList}{
+A list of lists of graphical parameters. The \code{VennThemes} function produces a suitable list; see its man page for more details.
+}
+  \item{show}{
+A list of options controlling what is shown. Defaults are \code{universe = TRUE, Sets = TRUE, SetLabels = TRUE, 
+        DarkMatter = FALSE, Faces = TRUE, FaceText = "weight"}. If \code{universe = TRUE} the bounding region, currently always a rectangle,
+of the diagram is shown. If \code{Sets = TRUE}, the boundaries of the Sets are shown. If \code{SetLabels = TRUE} the names of
+the Sets are plotted according to the instructions in \code{VennGetSetLabels(C3)}. If \code{Faces = TRUE}
+individual faces are filled. \code{FaceText} is a character vector which may contain any of 
+\code{c("weight","signature","sets","elements")}. Currently \code{DarkMatter} must be \code{FALSE}.
+}
+}
+\details{
+The algorithm for displaying face annotation is pretty crude. The annotation corresponding to each member of the
+\code{FaceText} vector is displayed on a single line. \code{weight} and \code{signature} display the associated 
+weight and signature for the face. \code{sets} produces a concatenated version of the names of the sets in the face,
+while \code{elements} does the same for the elements; both of these only really work for single character set names or elements.
+}
+\author{
+Jonathan Swinton (jonathan at swintons.net)
+}
+\examples{
+library(Vennerable)
+setList <- strsplit(month.name,split="")
+names(setList) <- month.name
+C3 <- compute.Venn(Venn(setList[1:3]))
+PlotVennGeometry(C3,show=list(FaceText="signature"),gp=VennThemes(C3,colourAlgorithm="signature"))
+}
+% Add one or more standard keywords, see file 'KEYWORDS' in the
+% R documentation directory.
+\keyword{ graphs}

Modified: pkg/Vennerable/man/TissueDrawing-class.Rd
===================================================================
--- pkg/Vennerable/man/TissueDrawing-class.Rd	2009-09-23 23:10:53 UTC (rev 59)
+++ pkg/Vennerable/man/TissueDrawing-class.Rd	2009-09-25 18:08:14 UTC (rev 60)
@@ -79,9 +79,6 @@
 boundary of the 'dark matter', the Face defined as the region where none of the Sets intersect.
 Nevertheless this portion of the code is currently quite buggy and this can lead to errors in some computed diagrams.
 
-\code{CircleDrawing} and \code{SquaresDrawing} are classes which inherit from \code{TissueDrawing}
-to allow them to override some display-related functions (\code{VisibleRange} and \code{SetLabels} respectively)
-for efficiency or aesthetic purposes.
  }
 
 \examples{

Added: pkg/Vennerable/man/VennSetSetLabels.Rd
===================================================================
--- pkg/Vennerable/man/VennSetSetLabels.Rd	                        (rev 0)
+++ pkg/Vennerable/man/VennSetSetLabels.Rd	2009-09-25 18:08:14 UTC (rev 60)
@@ -0,0 +1,57 @@
+\name{VennSetSetLabels}
+\Rdversion{1.1}
+\alias{VennSetSetLabels}
+\alias{VennGetSetLabels}
+\alias{VennSetFaceLabels}
+\alias{VennGetFaceLabels}
+\alias{VennSetUniverse}
+\alias{VennGetUniverse}
+\title{
+Set and get annotation labels and graphical styles
+}
+\description{
+Embedded within a \code{VennDiagram} object are instructions for displaying annotation
+for the sets and their faces. Retrieve them so they can be edited
+and re-embedded for subsequent display.
+}
+\usage{
+VennGetSetLabels(object)
+VennSetSetLabels(object, SetLabels)
+VennGetFaceLabels(object)
+VennSetFaceLabels(object, FaceLabels)
+VennGetUniverse(object)
+VennSetUniverse(object, universe)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+  \item{object}{
+An object of class \code{VennDrawing}
+}
+  \item{SetLabels}{
+A data.frame. The format of this data.frame may change. 
+}
+  \item{FaceLabels}{
+A data.frame. The format of this data.frame may change. 
+}
+  \item{universe}{
+An \eqn{nx2} matrix defining \eqn{x} and \eqn{y} coordinates of the bounding universe. 
+Currently assumed to have 2 rows by much of the code, 
+corresponding to the lower left and upper right corners of a bounding rectangle}
+}
+\author{
+Jonathan Swinton (jonathan at swintons.net)
+}
+\examples{
+data(StemCell)
+Vstem <- Venn(StemCell)
+Vstem3 <- Vstem[,c("OCT4","SOX2","NANOG")]
+Cstem3 <- compute.Venn(Vstem3,doWeights=TRUE)
+plot(Cstem3)
+# don't like the default position of 'SOX2'?
+SetLabels <- VennGetSetLabels(Cstem3)
+SetLabels[SetLabels$Label=="SOX2","x"] <- 12
+Cstem3 <- VennSetSetLabels(Cstem3,SetLabels)
+grid.newpage()
+plot(Cstem3)
+}
+\keyword{ graphs }

Modified: pkg/Vennerable/man/VennThemes.Rd
===================================================================
--- pkg/Vennerable/man/VennThemes.Rd	2009-09-23 23:10:53 UTC (rev 59)
+++ pkg/Vennerable/man/VennThemes.Rd	2009-09-25 18:08:14 UTC (rev 60)
@@ -10,7 +10,7 @@
 to the \code{VennDrawing} method for \code{plot}.
 }
 \usage{
-VennThemes(drawing, colourAlgorithm)
+VennThemes(drawing, colourAlgorithm, increasingLineWidth)
 }
 \arguments{
   \item{drawing}{
@@ -19,9 +19,13 @@
   \item{colourAlgorithm}{
 Missing or one of \code{signature},\code{binary},\code{sequential}. 
 }
+\item{increasingLineWidth}{
+Logical, defaul \code{FALSE}
 }
+
+}
 \details{
-Set boundary colours  are taken from the \code{\link[RColorBrewer]{RColorBrewer}} \code{Set1} palette.
+Set boundary colours  are taken from the \code{Set1} palette provided by the \code{\link[RColorBrewer]{RColorBrewer}} package.
 If \code{colourAlgorithm="signature"}, face fill colours are taken frome the  \code{RColorBrewer} \code{YlOrRed} 
 palette based on the number of sets represented in the face, so eg all the faces corresponding to membership of a single set are pale yellow while the face corresponding to all the intersections is dark red.
 If \code{colourAlgorithm="binary"}, faces are blue if they correspond to an odd number of intersections and white otherwise.
@@ -31,7 +35,8 @@
 If not specified, \code{sequential} is used if there are less than 9 faces, otherwise
 \code{signature}.
 
-
+If \code{increasingLineWidth=TRUE}, each Set is given a different linewidth, with the last to be plotted given the thinnest width, to help in 
+visualising nonsimple Venn diagrams.
 }
 \value{
 A list with four elements
@@ -39,6 +44,7 @@
   \item{FaceText }{Named list of graphical parameters which will be applied to annotation in faces with corresponding names }
   \item{Set }{Named list of graphical parameters which will be applied to sets with corresponding names }
   \item{FaceText }{Named list of graphical parameters which will be applied to annotation in sets with corresponding names }
+These are graphical parameters in the sense of the \code{grid} package. 
 }
 \author{
 Jonathan Swinton (jonathan at swintons.net)
@@ -47,12 +53,16 @@
 See also \code{\link[RColorBrewer]{RColorBrewer}}
 }
 \examples{
-# change SetNames to large red text
+# change the name of one set  to red text and enlarge the other
 C2 <- compute.Venn(Venn(n=2))
 gp <- VennThemes(C2)
-gp[["SetText"]] <- lapply(gp[["SetText"]],function(gps){gps$col<-"red";gps$cex<-2;gps})
+gp[["SetText"]][["Set1"]]$col <-  "red";
+gp[["SetText"]][["Set2"]]$cex <- 2;
 plot(C2,gp=gp)
+# use  highlevel arguments
+gp <- VennThemes(C2,colourAlgorithm="binary")
+plot(C2,gp=gp)
+gp <- VennThemes(C2,increasingLineWidth=TRUE)
+plot(C2,gp=gp)
 }
-% Add one or more standard keywords, see file 'KEYWORDS' in the
-% R documentation directory.
 \keyword{ graphs}% 
\ No newline at end of file

Modified: pkg/Vennerable/man/Vennerable-internal.Rd
===================================================================
--- pkg/Vennerable/man/Vennerable-internal.Rd	2009-09-23 23:10:53 UTC (rev 59)
+++ pkg/Vennerable/man/Vennerable-internal.Rd	2009-09-25 18:08:14 UTC (rev 60)
@@ -5,8 +5,6 @@
 \alias{VDedgeDrawn-class}
 \alias{VDedgeLines-class}
 \alias{VDedgeSector-class}
-\alias{TDEdgeList-class}
-\alias{TDEdgeList-class}
 \alias{.edge.to.xy-methods} 
 \alias{.edge.to.xy,VDedgeLines,missing-method}
 \alias{.edge.to.xy,VDedgeLines,numeric-method} 
@@ -111,7 +109,6 @@
 \alias{PlotSetLabels}
 \alias{PlotUniverse}
 \alias{plotVenn}
-\alias{PlotVennGeometry}
 \alias{plotxygraph}
 \alias{pnpoly}
 \alias{pnpolytest}

Modified: pkg/Vennerable/man/compute.Venn.Rd
===================================================================
--- pkg/Vennerable/man/compute.Venn.Rd	2009-09-23 23:10:53 UTC (rev 59)
+++ pkg/Vennerable/man/compute.Venn.Rd	2009-09-25 18:08:14 UTC (rev 60)
@@ -2,10 +2,10 @@
 \Rdversion{1.1}
 \alias{compute.Venn}
 \title{
-Computes a geometrical description of a Venn diagram.
+Calculate the geometry of a Venn or Euler diagram.
 }
 \description{
-Takes an object of class \code{Venn} and returns one of class \code{VennDrawing}.
+Given an object of class \code{Venn}, compute an appropriate diagram.
 }
 \usage{
 compute.Venn(V, doWeights = TRUE, doEuler = FALSE, type)
@@ -13,94 +13,30 @@
 %- maybe also 'usage' for other objects documented here.
 \arguments{
   \item{V}{
-An object of class \code{Venn}. Must be present.
+An object of class \code{Venn}
 }
   \item{doWeights}{
-If \code{TRUE}, attempt to produce a diagram in which the areas of faces are proportional to \code{Weights(Venn)}.
-
+Logical
 }
   \item{doEuler}{
-If \code{TRUE}, attempt to produce a diagram in which faces with \code{Weights(Venn)==0} are suppressed..
+Logical
 }
   \item{type}{
-	One of \code{squares,circles,ellipses,triangles,AWFE, AWFEscale, battle, cog}.
+One of \code{"circles","squares","triangles","ellipses","AWFE","ChowRuskey","AWFE"}.
 }
 }
 \details{
-See the \code{Venn} vignette for more details.
+For more details see the package vignette with \code{vignette("Venn")}
 }
 \value{
-An object of class \code{VennDrawing}.
+An object of class \code{VennDrawing}
 }
 \author{
 Jonathan Swinton (jonathan at swintons.net)
 }
 \examples{
-
-## The function is currently defined as
-function (V, doWeights = TRUE, doEuler = FALSE, type) 
-{
-    nSets <- NumberOfSets(V)
-    if (nSets < 2) {
-        stop("Not enough sets")
-    }
-    if (missing(type)) {
-        type <- if (nSets == 2) {
-            "circles"
-        }
-        else if (nSets == 3) {
-            "circles"
-        }
-        else if (nSets == 4) {
-            if (doWeights) 
-                "ChowRuskey"
-            else "squares"
-        }
-        else {
-            if (doWeights) 
-                "ChowRuskey"
-            else "AWFE"
-        }
-    }
-    C3 <- switch(type, AWFE = , AWFEscale = , battle = , cog = , 
-        compute.AWFE(V, type = type), ChowRuskey = , compute.CR(V, 
-            doWeights), circles = , if (nSets == 2) {
-            compute.C2(V, doWeights, doEuler)
-        }
-        else if (nSets == 3) {
-            compute.C3(V, doWeights)
-        }
-        else {
-            stop(sprintf("Type \%s not implemented for \%d sets", 
-                type, nSets))
-        }, squares = , if (nSets == 2) {
-            compute.S2(V, doWeights, doEuler)
-        }
-        else if (nSets == 3) {
-            compute.S3(V, doWeights)
-        }
-        else if (nSets == 4) {
-            compute.S4(V, doWeights)
-        }
-        else {
-            stop(sprintf("Type \%s not implemented for \%d sets", 
-                type, nSets))
-        }, triangles = , if (nSets == 3) {
-            compute.T3(V, doWeights)
-        }
-        else {
-            stop(sprintf("Type \%s not implemented for \%d sets", 
-                type, nSets))
-        }, ellipses = , if (nSets == 4) {
-            compute.E4(V, doWeights)
-        }
-        else {
-            stop(sprintf("Type \%s not implemented for \%d sets", 
-                type, nSets))
-        })
-    C3
-  }
+setList <- strsplit(month.name,split="")
+names(setList) <- month.name
+compute.Venn(Venn(setList[1:3]))
 }
-% Add one or more standard keywords, see file 'KEYWORDS' in the
-% R documentation directory.
 \keyword{ graphs }



More information about the Vennerable-commits mailing list