[adegenet-commits] r936 - in pkg: R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Jun 29 17:46:18 CEST 2011
Author: jombart
Date: 2011-06-29 17:46:17 +0200 (Wed, 29 Jun 2011)
New Revision: 936
Modified:
pkg/R/seqTrack.R
pkg/man/seqTrack.Rd
Log:
Removed conversion to graphNEL class: check passes, but FAQ #4 still there.
Fuck sake!
Modified: pkg/R/seqTrack.R
===================================================================
--- pkg/R/seqTrack.R 2011-06-29 15:12:56 UTC (rev 935)
+++ pkg/R/seqTrack.R 2011-06-29 15:46:17 UTC (rev 936)
@@ -337,21 +337,21 @@
##########################
## as("seqTrack", "graphNEL")
##########################
-if(require(graph)){
-setOldClass("seqTrack")
-setAs("seqTrack", "graphNEL", def=function(from){
- ## if(!require(ape)) stop("package ape is required")
- if(!require(graph)) stop("package graph is required")
+## if(require(graph)){
+## setOldClass("seqTrack")
+## setAs("seqTrack", "graphNEL", def=function(from){
+## ## if(!require(ape)) stop("package ape is required")
+## if(!require(graph)) stop("package graph is required")
- ori.labels <- rownames(from)
- from <- from[!is.na(from$ances),,drop=FALSE]
+## ori.labels <- rownames(from)
+## from <- from[!is.na(from$ances),,drop=FALSE]
- ## CONVERT TO GRAPH
- res <- ftM2graphNEL(ft=cbind(ori.labels[from$ances], ori.labels[from$id]), W=from$weight, edgemode = "directed", V=ori.labels)
- return(res)
-})
-}
+## ## CONVERT TO GRAPH
+## res <- ftM2graphNEL(ft=cbind(ori.labels[from$ances], ori.labels[from$id]), W=from$weight, edgemode = "directed", V=ori.labels)
+## return(res)
+## })
+## }
Modified: pkg/man/seqTrack.Rd
===================================================================
--- pkg/man/seqTrack.Rd 2011-06-29 15:12:56 UTC (rev 935)
+++ pkg/man/seqTrack.Rd 2011-06-29 15:46:17 UTC (rev 936)
@@ -167,6 +167,24 @@
## PLOT RESULTS
\dontrun{
if(require(graph) && require(Rgraphviz)){
+## quick convertion method to graphNEL ##
+setOldClass("seqTrack")
+setAs("seqTrack", "graphNEL", def=function(from){
+ ## if(!require(ape)) stop("package ape is required")
+ if(!require(graph)) stop("package graph is required")
+
+ ori.labels <- rownames(from)
+ from <- from[!is.na(from$ances),,drop=FALSE]
+
+
+ ## CONVERT TO GRAPH
+ res <- ftM2graphNEL(ft=cbind(ori.labels[from$ances], ori.labels[from$id]), W=from$weight, edgemode = "directed", V=ori.labels)
+ return(res)
+})
+## end conversion function ##
+
+
+
dat.g <- as(dat, "graphNEL")
res.g <- as(res, "graphNEL")
More information about the adegenet-commits
mailing list