Keeping Data and Code in the Same File

John D. Cook has another post in his series on coding in Org-mode. The latest emphasizes how you can keep data, code, and documentation in a single (Org) file.

There’s nothing new in that idea for most Irreal readers, of course, but there is one new thing I didn’t know. When you use a table as input data for a code block, the header is not part of the data by default. You can get Org-mode to pass the header too by specifying the unintuitive parameter :colnames no on the source block line. Cook also gives some Python code that shows how to print the table along with the header and also do some calculations on the data.

Cook is a consulting mathematician and I view this series of posts as him documenting his evolving use of Org-mode in his work. The whole series is worth a look.

This entry was posted in General and tagged , . Bookmark the permalink.