public
Description: Clojure-based, R-like statistical computing and graphics environment for the JVM
Homepage: http://incanter.org
Clone URL: git://github.com/liebke/incanter.git
incanter / docs / incanter-cheat-sheet.tex
100644 247 lines (183 sloc) 6.727 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
\documentclass[footexclude,twocolumn,DIV25,fontsize=10pt]{scrreprt}
 
% Author: David Edgar Liebke (based on Steve Tayon's Clojure cheat sheet)
% Comments, errors, suggestions: liebke(at)googlemail.com
 
 
% License
% Eclipse Public License v1.0
% http://opensource.org/licenses/eclipse-1.0.php
 
% Packages
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage[english]{babel}
\usepackage{tabularx}
 
\usepackage[table]{xcolor}
 
% Set column space
\setlength{\columnsep}{0.25em}
 
% Define colours
\definecolorset{hsb}{}{}{red,0,.4,0.95;orange,.1,.4,0.95;green,.25,.4,0.95;yellow,.15,.4,0.95}
 
\definecolorset{hsb}{}{}{blue,.55,.4,0.95;purple,.7,.4,0.95;pink,.8,.4,0.95;blue2,.58,.4,0.95}
 
\definecolorset{hsb}{}{}
{magenta,.9,.4,0.95;green2,.29,.4,0.95}
 
% Redefine sections
\makeatletter
\renewcommand{\section}{\@startsection{section}{1}{0mm}
{-1.7ex}{0.7ex}{\normalfont\large\bfseries}}
\renewcommand{\subsection}{\@startsection{subsection}{2}{0mm}
{-1.7ex}{0.5ex}{\normalfont\normalsize\bfseries}}
\makeatother
 
% No section numbers
\setcounter{secnumdepth}{0}
 
% No indentation
\setlength{\parindent}{0em}
 
% No header and footer
\pagestyle{empty}
 
 
% A few shortcuts
\newcommand{\cmd}[1] {\texttt{\textbf{{#1}}}}
\newcommand{\cmdline}[1] {
\begin{tabularx}{\hsize}{X}
\texttt{\textbf{{#1}}}
\end{tabularx}
}
 
\newcommand{\colouredbox}[2] {
\colorbox{#1!40}{
\begin{minipage}{0.95\linewidth}
{
\rowcolors[]{1}{#1!20}{#1!10}
#2
}
\end{minipage}
}
}
 
\begin{document}
 
\centerline{\Large{\textbf{Incanter Cheat Sheet}}}
\centerline{{\large{\textbf{\textit{Functions and Macros Overview}}}}}
 
\colouredbox{green}{
\section{Documentation \textmd{\textrm{(http://incanter.org/docs/api)}}}
\cmdline{doc find-doc source \textmd{\textrm{(clojure.contrib.repl-utils)}}}
}
 
\colouredbox{blue}{
\section{Charts and Plots \textmd{\textrm{(incanter.charts)}}}
 
\subsection{Common Functions}
\begin{tabularx}{\hsize}{lX}
Appearance:& \cmd{clear-background set-alpha set-background set-title set-x-label set-y-label}\\
View:& \cmd{view}\\
Save PNG:& \cmd{save}\\
\end{tabularx}
 
 
\subsection{XY Plots}
\begin{tabularx}{\hsize}{lX}
Create:& \cmd{xy-plot scatter-plot}\\
Add data:& \cmd{add-lines add-points add-function}\\
Annotate:& \cmd{add-points add-polygon, add-text} \\
\end{tabularx}
 
\subsection{Category Charts}
\begin{tabularx}{\hsize}{lX}
Create:& \cmd{bar-chart line-chart}\\
Add data:& \cmd{add-category}\\
\end{tabularx}
 
\subsection{Histograms}
\begin{tabularx}{\hsize}{lX}
Create:& \cmd{histogram}\\
Add data:& \cmd{add-histogram add-lines add-function}\\
\end{tabularx}
 
\subsection{Box Plots}
\begin{tabularx}{\hsize}{lX}
Create:& \cmd{box-plot}\\
Add data:& \cmd{add-box-plot}\\
\end{tabularx}
 
\subsection{Misc. Plots}
\begin{tabularx}{\hsize}{lX}
Create:& \cmd{qq-plot trace-plot bland-altman-plot}\\
\end{tabularx}
 
 
}
 
 
\colouredbox{yellow}{
\section{Matrices and Vectors \textmd{\textrm{(incanter.core)}}}
\begin{tabularx}{\hsize}{lX}
Create: & \cmd{matrix diag identity-matrix symmetric-matrix bind-columns bind-rows to-matrix} \\
Properties: & \cmd{dim ncol nrow rank condition matrix?} \\
Selection: & \cmd{sel diag group-by} \\
Element-wise ops: & \cmd{plus minus mult div exp log log10 log2 pow sin cos tan asin acos atan abs} \\
Matrix ops: & \cmd{mmult kronecker solve trace det} \\
Transform: & \cmd{trans vectorize half-vectorize to-list to-vect} \\
Decomp: & \cmd{decomp-cholesky decomp-eigenvalue decomp-lu decomp-qr decomp-svd} \\
View: & \cmd{view} \\
Save to file: & \cmd{save} \\
\end{tabularx}
 
}
 
 
\colouredbox{green}{
\section{I/O \textmd{\textrm{(incanter.io)}}}
\begin{tabularx}{\hsize}{lX}
Read Data: & \cmd{read-dataset} \\
Write Data: & \cmd{save} \\
\end{tabularx}
 
}
 
\colouredbox{blue2}{
\section{Optimization \textmd{\textrm{(incanter.optimize)}}}
\cmdline{non-linear-model gradient hessian derivative integrate}
}
 
 
 
 
\colouredbox{magenta}{
\section{Data Sets \textmd{\textrm{(incanter.core)}}}
\begin{tabularx}{\hsize}{lX}
Create: & \cmd{dataset read-dataset \textmd{\textrm{(incanter.io)}} get-dataset \textmd{\textrm{(incanter.datasets)}}} \\
Properties: & \cmd{dim ncol nrow dataset?} \\
Selection: & \cmd{sel group-by} \\
Transform: & \cmd{to-matrix} \\
View: & \cmd{view} \\
Save to file: & \cmd{save} \\
\end{tabularx}
 
}
 
 
 
\colouredbox{orange}{
\section{Math \textmd{\textrm{(incanter.core)}}}
% \section{Math}
 
% \subsection{incanter.core}
\begin{tabularx}{\hsize}{lX}
Basic: & \cmd{plus minus mult div exp log log10 log2 pow sqr sq sum prod abs} \\
Trig: & \cmd{cos sin tan acos asin atan} \\
Special: & \cmd{beta gamma regularized-beta incomplete-beta} \\
Misc.: & \cmd{choose factorial sum-of-squares solve-quadratic} \\
\end{tabularx}
 
}
 
 
\colouredbox{green}{
\section{Probability \textmd{\textrm{(incanter.stats)}}}
\begin{tabularx}{\hsize}{lX}
PDF: & \cmd{pdf-beta pdf-binomial pdf-chisq pdf-exp pdf-f pdf-gamma pdf-neg-binomial pdf-normal pdf-poisson pdf-t pdf-uniform} \\
CDF: & \cmd{cdf-beta cdf-binomial cdf-chisq cdf-empirical cdf-exp cdf-f cdf-gamma cdf-neg-binomial cdf-normal cdf-poisson cdf-t cdf-uniform} \\
Quantile: & \cmd{quantile quantile-normal quantile-t} \\
Sampling: & \cmd{sample sample-beta sample-binomial sample-chisq sample-dirichlet sample-exp sample-gamma sample-inv-wishart sample-mvn sample-neg-binomial sample-normal sample-poisson sample-t sample-uniform sample-wishart} \\
\end{tabularx}
}
 
 
\colouredbox{pink}{
\section{Statistics \textmd{\textrm{(incanter.stats)}}}
\begin{tabularx}{\hsize}{lX}
Summary: & \cmd{mean variance sd skewness kurtosis median cumulative-mean tabulate detabulate} \\
Association: & \cmd{covariance correlation} \\
Tests: & \cmd{chisq-test t-test permutations bootstrap} \\
Regression: & \cmd{linear-model} \\
\end{tabularx}
}
 
 
\colouredbox{red}{
\section{Bayesian Inference \textmd{\textrm{(incanter.bayes)}}}
\begin{tabularx}{\hsize}{lX}
Sampling: & \cmd{sample-model-params sample-multinomial-params sample-proportions } \\
Plots: & \cmd{trace-plot histogram} \\
\end{tabularx}
 
}
 
 
\colouredbox{yellow}{
\section{Censored Data \textmd{\textrm{(incanter.censored)}}}
\cmdline{censored-mean-lower censored-mean-two-sided censored-mean-upper censored-variance-lower censored-variance-two-sided censored-variance-upper truncated-variance}
}
 
 
 
 
 
\begin{flushright}
\footnotesize
\rule{0.7\linewidth}{0.25pt}
\verb!$Revision: 1.1, $Date: October 23, 2009!\\
\verb!David Edgar Liebke (liebke googlemail com)!
\end{flushright}
 
% history
%
% v1.00
% First version based on API documentation
% http://incanter.org/docs/api
% LaTeX format based on Steve Tayon's Clojure Cheat Sheet
%
% v1.1
% Removed redundancies from Charts and Plots section
 
\end{document}