Replies: 1 comment
-
Julien,
Each code chunk is turned into a separate do file. Each do file is run as a separate Stata session in batch mode, producing a log file. Then the log file is read back into knitr, cleaned up, and inserted into your document.
By default, do files and log files are temporary files, so they will not clutter up your document folder. If you want to save these files, you can set the chunk option savedo=TRUE (see https://cran.r-project.org/web/packages/Statamarkdown/Statamarkdown.pdf, p2). You can set this per chunk, or as a global document default.
If you choose to save do and log files, they will appear in R’s working directory. This can be reset within a document with
```
knitr::opts_knit$set(root.dir=”/new/default/folder”)
```
This then becomes Stata’s internal working directory as well for finding and saving data sets or graph files. To change where Stata looks for files within a session, you use the `cd` command, either in your code or in a profile.do or sysprofile.do.
Doug Hemken
From: jules-bec ***@***.***>
Sent: Tuesday, March 28, 2023 4:27 PM
To: Hemken/Statamarkdown ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [Hemken/Statamarkdown] Do-Files created my Statamarkdown (Discussion #35)
Hello everyone,
I have a question regarding do-files that are created by Stata-chunks in a Markdown document using the Statamarkdown-package. Do-files as well as text-files of these chunks seem to be created and saved into the folder of the Markdown-document. Could someone explain to me when these do-file are created? Because to me it seems like not every Stata-chunk creates a do- and text-file of said chunk. Another thing I would like to know is whether it is possible to create a specific folder in which to save the created do- and text-files, because they are messin up my folder-hygiene. Every help would be very much appreiated.
Kind regards,
Julien
—
Reply to this email directly, view it on GitHub<#35>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACYBME3FMJDSVQSTCXV5GGDW6NJSBANCNFSM6AAAAAAWLDVSPA>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone,
I have a question regarding do-files that are created by Stata-chunks in a Markdown document using the Statamarkdown-package. Do-files as well as text-files of these chunks seem to be created and saved into the folder of the Markdown-document. Could someone explain to me when these do-file are created? Because to me it seems like not every Stata-chunk creates a do- and text-file of said chunk. Another thing I would like to know is whether it is possible to create a specific folder in which to save the created do- and text-files, because they are messin up my folder-hygiene. Every help would be very much appreiated.
Kind regards,
Julien
Beta Was this translation helpful? Give feedback.
All reactions