I am trying to solve linear programming problem by R software . I have three files named A.txt, B.txt,F.txt . I have read this by the following code:
library( linprog )
Amat<-read.table("D:/Simplex/SimplexInitialTheoryWithRsoftware/src/A.txt",header=FALSE,sep=" ")
bvec<-read.table("D:/Simplex/SimplexInitialTheoryWithRsoftware/src/B.txt",header=FALSE,sep=" ")
cvec<-read.table("D:/Simplex/SimplexInitialTheoryWithRsoftware/src/F.txt",header=FALSE,sep=" ")
The link of the file is A.txt , B.txt , F.txt . I am trying to solve this problem by R software by the following code .
res <- solveLP( cvec, bvec, Amat, TRUE )
## print the results
print( res )
But I am getting the following error .
Error in solveLP(cvec, bvec, Amat, TRUE) :
Matrix A must have as many rows as constraints (=elements of vector b) and as many columns as variables (=elements of vector c).
But I have checked my file again and again . The dimension of A is 10*10 , dimension of B is 10*1 and dimension of F is 1*10 .
So why I am getting the error ?
Update : I have got an error after the following code .
cvec<-read.table("D:/Simplex/SimplexInitialTheoryWithRsoftware/src/F.txt",header=FALSE,sep=" ")
And the error is
Warning message:
In read.table("D:/Simplex/SimplexInitialTheoryWithRsoftware/src/F.txt", :
incomplete final line found by readTableHeader on 'D:/Simplex/SimplexInitialTheoryWithRsoftware/src/F.txt'
My assumption is that , the error is caused due to this line of code .