Automatically Print R Objects to Appropriate Formats According to the 'knitr' Output Format