[Phylobase-commits] r222 - branches/pdcgsoc/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat Aug 2 10:40:26 CEST 2008
Author: pdc
Date: 2008-08-02 10:40:26 +0200 (Sat, 02 Aug 2008)
New Revision: 222
Added:
branches/pdcgsoc/R/methods-oldclasses.R
Modified:
branches/pdcgsoc/R/methods-phylo4.R
branches/pdcgsoc/R/methods-phylo4d.R
branches/pdcgsoc/R/phylo4.R
Log:
change reorder to conform to stats generic
add a reorder method for oldclass phylo so that ape commands aren't broken
Added: branches/pdcgsoc/R/methods-oldclasses.R
===================================================================
--- branches/pdcgsoc/R/methods-oldclasses.R (rev 0)
+++ branches/pdcgsoc/R/methods-oldclasses.R 2008-08-02 08:40:26 UTC (rev 222)
@@ -0,0 +1,4 @@
+setMethod("reorder", signature(x = "phylo"), function(x, order = 'cladewise') {
+ x <- reorder.phylo(x, order)
+ x
+})
Modified: branches/pdcgsoc/R/methods-phylo4.R
===================================================================
--- branches/pdcgsoc/R/methods-phylo4.R 2008-08-02 05:33:15 UTC (rev 221)
+++ branches/pdcgsoc/R/methods-phylo4.R 2008-08-02 08:40:26 UTC (rev 222)
@@ -295,7 +295,7 @@
object
})
-setMethod("reorder", signature(object = 'phylo4'), function(object, type = 'pruningwise') {
+setMethod("reorder", signature(x = 'phylo4'), function(x, order = 'cladewise') {
reorder.prune <- function(edge, tips, root = tips + 1) {
## if(is.null(root)) {
## root <- tips + 1
@@ -314,7 +314,6 @@
if(type == 'pruningwise') {
index <- reorder.prune(object at edge, length(object at tip.label))
}
- print('test')
object at edge <- object at edge[index, ]
object at edge.label <- object at edge.label[index]
object at edge.length <- object at edge.length[index]
Modified: branches/pdcgsoc/R/methods-phylo4d.R
===================================================================
--- branches/pdcgsoc/R/methods-phylo4d.R 2008-08-02 05:33:15 UTC (rev 221)
+++ branches/pdcgsoc/R/methods-phylo4d.R 2008-08-02 08:40:26 UTC (rev 222)
@@ -157,7 +157,7 @@
return(rev(temp))
})
-setMethod("reorder", signature(object = 'phylo4d'), function(object, type = 'pruningwise') {
+setMethod("reorder", signature(x = 'phylo4d'), function(x, order = 'cladewise') {
reorder.prune <- function(edge, tips, root = tips + 1) {
## if(is.null(root)) {
## root <- tips + 1
Modified: branches/pdcgsoc/R/phylo4.R
===================================================================
--- branches/pdcgsoc/R/phylo4.R 2008-08-02 05:33:15 UTC (rev 221)
+++ branches/pdcgsoc/R/phylo4.R 2008-08-02 08:40:26 UTC (rev 222)
@@ -82,7 +82,7 @@
setGeneric("na.omit")
-setGeneric("reorder", def = function(object, type = 'pruningwise') {
+setGeneric("reorder", def = function(x, order = 'cladewise') {
standardGeneric("reorder")}, package = 'phylobase', useAsDefault = FALSE)
More information about the Phylobase-commits
mailing list