[Mattice-commits] r135 - pkg/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Jan 8 23:46:19 CET 2009
Author: andrew_hipp
Date: 2009-01-08 23:46:19 +0100 (Thu, 08 Jan 2009)
New Revision: 135
Modified:
pkg/R/plot.ouSim.R
pkg/R/summarizingAnalyses.R
Log:
fixing three S3 generic/method consistency errors
Modified: pkg/R/plot.ouSim.R
===================================================================
--- pkg/R/plot.ouSim.R 2009-01-08 22:34:50 UTC (rev 134)
+++ pkg/R/plot.ouSim.R 2009-01-08 22:46:19 UTC (rev 135)
@@ -1,13 +1,13 @@
-plot.ouSim <- function(ouSim, nodeColor = "blue", nodeDotSize = 1.4, colors = NULL, ...) {
+plot.ouSim <- function(x, nodeColor = "blue", nodeDotSize = 1.4, colors = NULL, ...) {
## To plot different clades, set the colors vector according to the branches in the original
## only passes the ... along to lines
- branches = length(ouSim$branchList)
+ branches = length(x$branchList)
if(length(nodeColor) == 1) nodeColor <- rep(nodeColor, branches)
if(identical(colors, NULL)) {
- if("colors" %in% names(ouSim)) colors <- ouSim$colors
+ if("colors" %in% names(x)) colors <- x$colors
else colors <- rep("black", branches)
}
- plot(1:ouSim$steps, ylim = range(unlist(ouSim$branchList)), type = "n", ylab = "Trait value", xlab = "Time")
- for(i in 1:branches) lines(ouSim$timesList[[i]], ouSim$branchList[[i]], col = colors[i], ...)
- for(i in 1:branches) points(ouSim$timesList[[i]][1], ouSim$branchList[[i]][1], pch = 19, col = nodeColor[i], cex = nodeDotSize)
+ plot(1:x$steps, ylim = range(unlist(x$branchList)), type = "n", ylab = "Trait value", xlab = "Time")
+ for(i in 1:branches) lines(x$timesList[[i]], x$branchList[[i]], col = colors[i], ...)
+ for(i in 1:branches) points(x$timesList[[i]][1], x$branchList[[i]][1], pch = 19, col = nodeColor[i], cex = nodeDotSize)
}
\ No newline at end of file
Modified: pkg/R/summarizingAnalyses.R
===================================================================
--- pkg/R/summarizingAnalyses.R 2009-01-08 22:34:50 UTC (rev 134)
+++ pkg/R/summarizingAnalyses.R 2009-01-08 22:46:19 UTC (rev 135)
@@ -2,8 +2,9 @@
# FUNCTIONS FOR SUMMARIZING ANALYSES
# ---------------------------------------------------------------------
-summary.hansenBatch <- function(hansenBatch, ...){
+summary.hansenBatch <- function(x, ...){
## items in output: hansens, regimeList, regimeMatrix
+ hansenBatch <- x
icObject <- informationCriterion.hansenBatch(hansenBatch) # Get information criterion weights for all models
nmodels <- dim(hansenBatch$hansens[[1]])[1] # number of models per tree (ignores the fact that models may not be present in all trees)
ntrees <- length(hansenBatch$hansens) # number of trees
@@ -74,8 +75,9 @@
return(x)
}
-print.hansenSummary <- function(hansenSummary, ...) {
+print.hansenSummary <- function(object, ...) {
## This just formats a hansenSummary object so that it is readable on the screen; you can still store the summary object and extract elements as needed
+ hansenSummary <- object
message(paste("\nSummarizing hansenBatch analyses over", length(hansenSummary$modelsMatrix), "trees and", dim(hansenSummary$modelsMatrix[[1]])[1], "models"))
message("-----------------------------------------------------------")
message("ESTIMATED SUPPORT FOR CHANGES OCCURRING AT DESIGNATED NODES")
More information about the Mattice-commits
mailing list