Error in rstudio function (with boot package)

Hi,
I wrote a function in Rstudio; but when i run it, i have an error but i don't know how to fix it. A screenshot of the error is attached

That is the function

library(boot)
FBA <- function(S, C, c, w, maxi){
S <- matrix(c(1,-1,-1,0,0, 0,1,0,-1,0, 0,0,1,0,-1), nrow = 3, ncol = 5, byrow = TRUE,
dimnames = list(c("CoA", "ATP", "Fruct6P"),
c("v1", "v2", "v3", "v4", "v5")))
n <- dim(S)[2]
m <- dim(S)[1]
I <- matrix(0, ncol=5, nrow=3)
diag(I) <- 1
zero <- rep(0,m)
c <- rep(0,5)
C <- rep(1,5)
w <- c(0,1,0,0,0) # puisque maximiser l'ATP revient à maximiser le flux de v2
result <- simplex(a=w, A1=I, b1=C, A2=I, b2=c, A3=S, b3=zero, maxi=TRUE)
return(result)
}

Can you orient me please?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.