Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Convert memory data to markdown table

    Please, is there a way to convert data (Not result from commands) in stata memory to a markdown table, preferably pandoc table?

  • #2
    I finally came up with a kable command for stata available on this gist: https://gist.github.com/f0226f009b9d...d218dab1630da0


    There is no documentation though.

    The kable program is applied to in memory dataset, and you can export the result either to a md/txt file or just print it on the console.

    An interesting work arround is to use the kable program within a dyntex file and convert the dyntex using pandoc to any desired format.

    The tables are hard coded in pandoc grid tables

    Here are simple examples (after executing/loading the kable program)

    sysuse auto, clear
    kable

    or

    sysuse auto, clear
    kable, usevarnames

    or

    sysuse auto, clear
    kable, usevarlabels out("temp.md")


    I know the code needs probably to be improved, but a least it gives something to start with.

    Hope this helps.

    Comment

    Working...
    X