Decumar
An alternative to sweave
Install / Use
/learn @hadley/DecumarREADME
decumar
Decumar is a tool for interleaving latex and R. It uses specially formatted comment blocks, so your file is always valid latex.
Decumar is similar to sweave, but comes from a slightly different heritage. As well as deriving inspiration from literate programming, it also draws ideas from code generation. Why should you use decumar instead of sweave?
- you only need one file
- it's always valid latex
- caching is built in
- you don't need to manually print ggplot2 and lattice plots
- more types of output (figures, listing, ...)
Basic format
Decumar blocks look like this:
% BLOCKTYPE
% OPTION1: value 1
% OPTION2: value 2
%
% a <- 10
% a + b
latex
Decumar expects the following in your preamble:
\usepackage{alltt}
\usepackage{graphicx}
\DeclareGraphicsExtensions{.png,.pdf}
\graphicspath{{graphics-path/}}
blocks
Decumar currently supports the following block types:
-
DEFAULTS: set up default parameters
-
CODE: execute code, but don't display it
-
LISTING: display code, but don't execute it
-
CODELISTING: execute and display code
-
INTERWEAVE: interweave each line of code with its results
-
GRAPHIC: insert a bare graphic
-
FIGURE: insert multiple graphics in a floating figure
-
FIGLISTING: insert a figure and the display the code used to create it
Related Skills
node-connect
352.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
352.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
352.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
