Rev 256 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
%%- \documentclass[a4paper,12pt]{article}%%- \usepackage{a4}%------ ##--- (so I can print it '2on1' ...)%%-%%- \begin{document}%%- \author{Paul Murrell \\ Statistics, Auckland, NZ}%%- \date{Sept.~11, 1997}%%-%%- \title{Documentation for \\%%- Mathematical Annotation in $R$}%%- \maketitle%%- \author{Paul Murrell \\ Statistics, Auckland, NZ}%%- \date{Sept.~11, 1997}%%-%%- \title{%%%- Documentation for \\%%- Mathematical Annotation in $R$}%%- \maketitleIf the {\tt text} argument to one of the text-drawing functions ({\tttext}, {\tt mtext}, {\tt axis}) in \R\ is an expression, the argumentis interpreted as a mathematical expression and the output will beformatted according to \TeX -like rules.A mathematical expression must obey the normal rules of syntax forany \R\ expression, but it is interpreted according to verydifferent rules than for normal \R\ expressions.\begin{description}\item[binary operators] addition, subtraction, multiplication, anddivision use the standard \R\ syntax, although multiplication onlyjuxtaposes the arguments. For example, {\tt a+b}, {\tt a-b}, and {\tta/b}, produce $a+b$, $a-b$, and $a/b$, but {\tt a*b} produces $ab$.\item[unary operators] positive and negative numbers are specifiedwith standard syntax. For example, {\tt +x} produces $+x$ and {\tt-y} produces $-y$.\item[subscripts and superscripts] a subscript is specifiedusing the subsetting syntax and a superscript is specified usingthe power syntax. For example, {\tt x[i]} produces$x_i$ and {\tt x\^{}2} produces $x^2$.\item[accents] accented expressions are specified using the specialmathematical functions {\tt hat} and {\tt bar}. For example, {\tthat(x)} produces $\hat x$ and {\tt bar(x)} produces $\bar x$.\item[fractions] fractions are specified using the specialmathematical function {\tt frac} (or its alias, {\tt over}).For example, {\tt frac(1,2)} produces $1\over2$.\item[relations] equality or assignment of terms is specified usingthe {\tt ==} relation. For example, {\tt x == y} produces $x=y$.\item[visible grouping] terms are visibly grouped by placing themwithin parentheses. For example, {\tt (x+y)} produces $(x+y)$.\item[invisible grouping] terms are invisibly grouped by placingthem within curly braces. For example \verb|x^{2*y}| produces$x^{2y}$, whereas {\tt x\^{}2*y} produces $x^2y$.\item[big operators] a sum, product, or integral is specified usingthe special mathematical function of the corresponding name. Eachof these functions takes three arguments; the first indicates whatis being summed/multiplied/integrated and the second and third specifythe limits of the summation/product/integral. For example, {\ttsum(x[i], i==0, n)} produces $\sum\limits_{i=0}^n x_i$.\item[radicals] a square root expression is specified using thespecial mathematical functions {\tt root} and {\tt sqrt}. Forexample, {\tt sqrt(x)} produces $\sqrt x$.\item[absolute values] an absolute term is specified using thespecial mathematical function {\tt abs}. For example, {\tt abs(x)}produces $\left|x\right|$.\item[juxtaposition] multiple terms are juxtaposed using the specialmathematical function {\tt paste}. For example, {\tt paste(over(b,2), y, sum(x))} produces ${b\over2} y \sum x$.\item[typeface changes] the default font in mathematical expressionsis italic (except for terms which are symbols). A new typeface isspecified using the special mathematical functions {\tt bold}, {\ttitalic}, {\tt plain}, and {\tt bolditalic}. For example, {\ttplain(X)[i]} produces ${\rm X}_i$. These font specifications do notaccumulate (i.e., {\tt bold(italic(x)))} produces $x$ (an italic "x"),whereas {\tt bolditalic(x)} produces \textit{\textbf{x}} (a bold, italic "x").\item[general expressions] any functional expression which is not aspecial mathematical function is simply reproduced as a functionexpression. For example, {\tt foo(x)} produces $foo(x)$.\end{description}%%- \end{document}%%% Local Variables:%%% mode: latex%%% TeX-master: Man.tex%%% End: