checkData function

check input data type and format and coerce to the desired output type