[Vennerable-commits] r43 - pkg/Vennerable/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Aug 4 23:29:24 CEST 2009
Author: js229
Date: 2009-08-04 23:29:23 +0200 (Tue, 04 Aug 2009)
New Revision: 43
Modified:
pkg/Vennerable/R/02TissueDrawing.R
Log:
fix silly multiple bug and improve .midpoint
Modified: pkg/Vennerable/R/02TissueDrawing.R
===================================================================
--- pkg/Vennerable/R/02TissueDrawing.R 2009-08-04 17:28:26 UTC (rev 42)
+++ pkg/Vennerable/R/02TissueDrawing.R 2009-08-04 21:29:23 UTC (rev 43)
@@ -588,18 +588,9 @@
midmean
})
setMethod(".midpoint",c("VDedgeSector"),function(edge){
- # could calculate midpoint directly
- edgexy <- .edge.to.xy(edge)
- if (nrow(edgexy)%%2 == 1) {
- midn <- (nrow(edgexy)+1)/2
- midn <- c(midn,midn)
- } else {
- midn <- nrow(edgexy)/2
- midn <- c(midn,midn+1)
- }
- midx <- edgexy[midn,]
- midmean <- matrix(apply(midx,2,mean),ncol=2)
- midmean
+ theta <- (edge at fromTheta+edge@toTheta)/2
+ point.xy <- .theta.to.point.xy(theta,r=edge at radius,centre=edge at centre)
+ point.xy
})
##############################################################################
@@ -633,7 +624,7 @@
for (faceName in faceNames) {
sig <- drawing at faceSignature[[faceName]]
if (sig=="DarkMatter" & suffix =="1") {
- sig <- paste(rep("0",length(drawing at setList)-1),"1",sep="")
+ sig <- paste(c(rep("0",length(drawing at setList)-1),"1"),collapse="")
} else {
sig <- paste(sig,suffix,sep="")
}
More information about the Vennerable-commits
mailing list