I'm having trouble storing my lpSolve solution in a c()
object, when I execute.
l=c()
l[1]=lp ("min",f.obj,f.con,f.dir,f.rhs)
I get an error:
unexpected symbol in "l[1]"
Does someone have a clue please?
Thanks in advance!
I'm having trouble storing my lpSolve solution in a c()
object, when I execute.
l=c()
l[1]=lp ("min",f.obj,f.con,f.dir,f.rhs)
I get an error:
unexpected symbol in "l[1]"
Does someone have a clue please?
Thanks in advance!
In order to add element in a list you need to do like below:
l <- list()
l[[1]] <- lp ("min",f.obj,f.con,f.dir,f.rhs)
If you want to add in a loop then you can try something like
l <- list()
i <- 1
while(<some condition>){
l[[i]] <- "your lpSolve solution"
i <- i+1
}