# NOT RUN {
# Generate eqnlist from the constructor
S <- matrix(c(-1, 1, 1, -1),
nrow = 2, ncol = 2,
dimnames = list(NULL, c("A", "B")))
rates <- c("k1*A", "k2*B")
description <- c("forward", "backward")
f <- eqnlist(smatrix = S, rates = rates, description = description)
print(f)
# Convert to data.frame
fdata <- as.data.frame(f)
print(fdata)
# Generate eqnlist from data.frame and add volume parameter
f <- as.eqnlist(fdata, volumes = c(A = "Vcyt", B = "Vnuc"))
print(f)
print(as.eqnvec(f))
print(as.eqnvec(f, type = "amount"))
# }
Run the code above in your browser using DataLab