function to validate the type of file format and open the corresponding file
outputType(
device,
dirSave = NULL,
fileName,
fileFmts,
combinePlts,
msg = "plot"
)string to select the output format: 'PDF'/'PNG'/'JPEG' or 'screen'
specify a valid directory where to save the file
name of the file
list with the acceptable format types, eg. c("PDF","PNG","JPEG")
boolean flag indicating whether plots are combined or not
optional string to customiza message to the user