R/print.summary.solveLP.R

Defines functions print.summary.solveLP

Documented in print.summary.solveLP

## print the summary results
print.summary.solveLP <- function( x, ... ) {
   object <- x

   cat("\n\nResults of Linear Programming / Linear Optimization\n")

   cat("\nObjective function")
   if( object$maximum ) {
      cat(" (Maximum): ")
   } else {
      cat(" (Minimum): ")
   }
   cat( object$opt, "\n" )

   cat("\nSolution\n")
   object$solution <- as.matrix(object$solution)
   colnames( object$solution ) <- c("opt")
   print( object$solution )
   cat("\n")
   invisible( x )
}

Try the linprog package in your browser

Any scripts or data that you put into this service are public.

linprog documentation built on May 2, 2019, 5:16 p.m.