R/print.testPort.R

`print.testPort` <-
function(x, ...){
	hold <- rbind(x$X, 100*(x$sumRet-1))
	hold <- as.data.frame(hold)
	rownames(hold) <- c('Opt. Portfolio', 'Stock change (%)')
	colnames(hold) <- names(x$sumRet)
	temp <- format(hold, digits=2, scientific=FALSE)
	cat('Change in portfolio value: ', round(100*(x$change-1),1), '%\n\n', sep='')
	print(temp)
}

Try the stockPortfolio package in your browser

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

stockPortfolio documentation built on May 29, 2017, 11:32 a.m.