The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
purl_stata() now writes each chunk’s header in the
*%% label, options ---- form which knitr uses when it
tangles a script in another language, instead of its own
* ---- label ---- form, so a do-file written by
purl_stata() and one tangled by knitr::purl()
look the same. The engine is dropped from the header, since the do-file
implies it.purl_stata() now uses
knitr::partition_chunk() to split a chunk’s option comments
from its code, so they are recognised and parsed exactly as knitr does
when the document is knitted: *| comments in a
stata chunk and #| comments in a chunk using
the older engine='stata' form. Values such as
purl: no are therefore understood, and a //|
line, which knitr does not treat as an option comment, is now kept as
(Stata comment) code instead of being dropped.spinstata() no longer needs engine='stata'
in the chunk headers of a “do” file: code in a chunk is taken to be
Stata code unless it is marked as R code with the
/*R ... R*/ markup, or the chunk header sets an
engine option itself. With knitr >= 1.53, Stata is also
used for code which is not preceded by a chunk header at all, in a
document which has no chunks of R code.spinstata() now calls knitr::spin()
directly, instead of the modified copy of it which the package had
carried since knitr 1.22. The copy was needed because
spin() could not handle a script which is not valid R code,
which was fixed in knitr 1.46 (yihui/knitr#1773). As a result
spinstata() gains the features spin() has
since acquired, including the format = "qmd" output format
and the # %% and #| chunk delimiters, and the
package now requires knitr >= 1.46.find_stata(message = FALSE) is now silent when no Stata
executable is found; previously the “No Stata executable found.” message
was printed whatever the value of message. The help file
examples use this, so the reference pages of the pkgdown site, which is
built without Stata, no longer end with that message.collectcode
hook. The engine now falls back to the executable located when the
package was attached, and re-registers the hook, so it is no longer
necessary to detach("package:Statamarkdown") between
documents.stata.fig=TRUE: exports the graph
drawn by a Stata chunk and includes it in the output document. The
figure goes through knitr’s standard plot machinery, so
fig.cap, fig.alt (alternative text, for
accessibility), out.width, out.height,
fig.align, fig.link and fig.path
all work as for R chunks. The export format is set with
stata.fig.format (default "svg", which Stata
batch mode supports on all platforms). In Rmd and Quarto documents the
hyphenated spellings stata-fig and
stata-fig-format are also accepted when using YAML style
chunk options. (thanks @kylebutts in #28)purl_stata(), the Stata analogue of
knitr::purl(): extracts the code from the Stata chunks of
an R Markdown or Quarto document into a do-file, recording each chunk’s
header (label and options) as a Stata comment, and following
knitr::purl()’s documentation levels
(2 also carries the document text over as Stata comments).
Chunks with purl=FALSE or eval=FALSE are
skipped, including via option comments in any of the forms knitr accepts
in Stata chunks (#|, *|, //|).
(thanks @davidaarmstrong in #39)collectcode chunk option when knitr evaluates
chunks in a different directory to the document, for example for a
document in a subfolder of an RStudio project with the “Evaluate chunks
in directory: Project” option set, or when knitting with
rmarkdown::render(knit_root_dir=). The temporary
profile.do is now created, and any pre-existing
profile.do snapshot and restored, in the directory where
the chunks (and therefore Stata) run. (thanks @DaniMori in #17)TRUEspinstata() no longer overwrites its input file; a
statafile without a .do extension is now an
error, and the extension check is case-insensitive.collectcode chunk option when
engine.path is given as a plain string rather than a
list.profile.do created by
collectcode now locates the knitr::knit() call
on the call stack instead of assuming a hardcoded stack depth, making it
robust to changes in knitr’s internals, child documents, and different
ways of invoking knitr.cleanlog=TRUE now removes all lines of multi-line loop
commands and wrapped (continued) command lines from the output.cleanlog=TRUE no longer deletes genuine output lines
that begin with a decimal point.spinstata() block tracking when a marked-up block
starts and ends on the same line.spinstata() on R >= 4.3 when
producing Rnw or Rtex output.find_stata() on Windows now stops searching as soon as
an executable is found, and the non-existent “StataNow19” directory stub
has been removed from the search.find_stata() now searches
/Applications/StataNow on macOS, the StataNow directories
on Windows, and two additional installation directories on Linux.find_stata() for Stata 19 and the SSCC
installation path.find_stata() for Stata 19.collectcode chunk option for knitr >=
1.45..onAttach() to
.onLoad().find_stata() for Stata 18.spinstata().find_stata(),
suggested by Tom Palmer.find_stata() directory search on Linux,
using Sys.which().find_stata() for Stata 17, with macOS
fixes.eval chunk option.collectcode chunk option for linking code
blocks, spinstata() for spinning specially marked-up Stata
do-files into reports, and find_stata() to locate the Stata
executable on Windows, macOS, and Linux.These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.