From c4e8498ee688fff1e1b2df1a7a65f888cb0d9d84 Mon Sep 17 00:00:00 2001 From: jranke Date: Wed, 25 Apr 2012 10:33:53 +0000 Subject: - Transferred some testing code from test.R to unit tests for mkinpredict - Fixed the output format of mkinpredict to be uniform across solution types git-svn-id: svn+ssh://svn.r-forge.r-project.org/svnroot/kinfit/pkg/mkin@33 edb9625f-4e0d-4859-8d74-9fd3b1da38cb --- R/mkinpredict.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'R') diff --git a/R/mkinpredict.R b/R/mkinpredict.R index be43b0e..493c578 100644 --- a/R/mkinpredict.R +++ b/R/mkinpredict.R @@ -57,8 +57,8 @@ mkinpredict <- function(mkinmod, odeparms, odeini, outtimes, solution_type = "de evalparse(paste("k", sub("free", "bound", parent.name), "free", sep="_")), evalparse(paste("k", parent.name, "sink", sep="_"))) ) - out <- cbind(outtimes, o) - dimnames(out) <- list(outtimes, c("time", sub("_free", "", parent.name))) + out <- data.frame(outtimes, o) + names(out) <- c("time", sub("_free", "", parent.name)) } if (solution_type == "eigen") { coefmat.num <- matrix(sapply(as.vector(mkinmod$coefmat), evalparse), @@ -70,8 +70,8 @@ mkinpredict <- function(mkinmod, odeparms, odeini, outtimes, solution_type = "de } o <- matrix(mapply(f.out, outtimes), nrow = length(mod_vars), ncol = length(outtimes)) - dimnames(o) <- list(mod_vars, outtimes) - out <- cbind(time = outtimes, t(o)) + out <- data.frame(outtimes, t(o)) + names(out) <- c("time", mod_vars) } if (solution_type == "deSolve") { mkindiff <- function(t, state, parms) { -- cgit v1.2.1