Knitting tables with kable

The kable function from the knitr package allows to display nicely formatted tables using R Markdown, as explained here. I recently encountered unexpected behaviour of kable when calling it from lapply or a function, which led to this post on StackOverflow. The answers were very detailed and enlightening, and I invite you to read them. They could be summarized in two points: be aware of side-effects, and prefer cat (with new lines) to print.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s