stata-and-r-markdown introduction background install-statamarkdown set-up-the-stata-engine link-code-blocks hints-and-examples code-separate-or-with-output including-graphs descriptive-statistics frequency-tables t-tests graphics installing-statamarkdown from-cran from-github from-this-website stata-engine-path introduction-1 loading-statamarkdown finding-the-stata-program loading-statamarkdown-again example rendering-documents rstudio-gui-versus-r-functions rendering-a-single-document rendering-multiple-documents linking-code-blocks linking-code-blocks-1 locals-scalars-and-globals an-example the-collectcode-chunk-option clear-collectcode stata-output-and-cleanlog removing-stata-code-from-output restoring-stata-code-to-output including-stata-graphs saving-a-stata-graph insert-via-markdown-for-html-or-pdf-documents insert-svg-via-r-html stata-graph-options inline-stata-results example-1 markdown stata-output-as-tables overview saving-stata-output read-into-r display-the-table combining-stata-and-r introduction-2 switching-languages using-stata using-r keeping-intermediate-files saving-the-stata-do-and-log-files saving-the-markdown-file saving-the-latex-file default-directories-in-statamarkdown r-working-directory stata-working-directory spin-stata stata-help-in-markdown introduction-3 example---help-graph the-r-markdown