R/message.R

Defines functions message stopMessage infoMessage

message<-function(messageType,names=""){
	messageList<-list(
			INFO_WELCOME='',
			FILE_CREDENTIALS_NO_EXISTS='Function util_setCredentials() should be called before. To retrieve your account credentials, please log in to your account or register for a free account at https://www.portfolioeffect.com/registration.',
			WRONG_SETTINGS_ARGUMENTS='',
			NOT_PORTFOLIO_CLASS='The object must have the class "portfolio". Use the function portfolio_create to create it.',
			NOT_OPTIMIZER_CLASS='The object must have the class "optimizer". Use the function optimization_goal to create it.',
			OBJECT_NOT_CHARACTER_CLASS=paste('The',names,'must have the class "character".'),
			OBJECT_NOT_NUMERIC_CLASS=paste('The',names,'must have the class "numeric".'),
			OBJECT_NOT_SINGLE_NUMBER=paste('The',names,'must be single number.'),
			OBJECT_NOT_POSITIVE_NUMBER=paste('The',names,'must be a positive number.')
	)
	return(messageList[[messageType]])
}

stopMessage<-function(messageType,names=""){
	stop(message(messageType,names))
}
infoMessage<-function(messageType,names=""){
	cat(message(messageType,names))
}

Try the PortfolioEffectHFT package in your browser

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

PortfolioEffectHFT documentation built on May 2, 2019, 11:52 a.m.