You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
---
title: "R Notebook"
output:
html_document:
df_print: paged
---
```{r, include=FALSE}
library(Statamarkdown)
```
A first code block:
```{stata first-Stata, collectcode=TRUE}
sysuse auto
generate gpm = 1/mpg
summarize price gpm
```
A second, later code block:
```{stata second-Stata}
regress price gpm
```
Open Rstudio
Click on "Tools" -> "Global Options..." -> "R Markdown".
In "Evaluate chunks in directory", select "Project" from the dropdown menu, then click "OK"
Create a new Rstudio project
Save the previous example as a .Rmd file in the root folder.
Knit the example; everything goes fine.
Now create a subfolder (e.g. notebooks), and copy the .Rmd file into that subfolder.
Knit the version of the .Rmd file in the subfolder.
The second chunk does not run properly, allegedly because collectcode=TRUE fails.
A profile.do is created in the subfolder and then deleted. However, it might be the case that Stata "looks for" the profile.do in the root directory of the project somehow.
Now:
Click on "Tools" -> "Global Options..." -> "R Markdown".
In "Evaluate chunks in directory", select "Document" from the dropdown menu, then click "OK"
Repeat step 5; the second chunk now runs properly. My guess is that this issue is related to #12 , and most probably to this response. However, I think this is a new use case that may help shed some light into the solution.
The text was updated successfully, but these errors were encountered:
DaniMori
changed the title
collectcode=TRUE only works for Rmarkdown documents in the root folder of the project (when chunks are set to evaluate in the root folder)collectcode=TRUE only works for Rmarkdown documents in the root folder of the project (when chunks are set to evaluate in the root folder)
May 5, 2021
Take the following example, adapted from the Statamarkdown handbook:
.Rmd
file in the root folder.notebooks
), and copy the.Rmd
file into that subfolder..Rmd
file in the subfolder.collectcode=TRUE
fails.A
profile.do
is created in the subfolder and then deleted. However, it might be the case that Stata "looks for" theprofile.do
in the root directory of the project somehow.Now:
Repeat step 5; the second chunk now runs properly. My guess is that this issue is related to #12 , and most probably to this response. However, I think this is a new use case that may help shed some light into the solution.
The text was updated successfully, but these errors were encountered: