diff options
author | jranke <jranke@edb9625f-4e0d-4859-8d74-9fd3b1da38cb> | 2012-04-25 10:33:53 +0000 |
---|---|---|
committer | jranke <jranke@edb9625f-4e0d-4859-8d74-9fd3b1da38cb> | 2012-04-25 10:33:53 +0000 |
commit | c4e8498ee688fff1e1b2df1a7a65f888cb0d9d84 (patch) | |
tree | bcc4a6136520f1e4b9f04760657875eca781ab70 /R | |
parent | 081b5f25cc4ef779175307d9ce20672e0573b7c9 (diff) |
- 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
Diffstat (limited to 'R')
-rw-r--r-- | R/mkinpredict.R | 8 |
1 files changed, 4 insertions, 4 deletions
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) { |