File: partitioning.Rnw

package info (click to toggle)
r-cran-vegan 2.5-7%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 5,564 kB
  • sloc: ansic: 2,275; fortran: 1,088; sh: 42; makefile: 2
file content (80 lines) | stat: -rw-r--r-- 2,691 bytes parent folder | download | duplicates (8)
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
%\VignetteIndexEntry{Partition of Variation}
%% This file rewrites Pierre Legendre's introduction and takes pages
%% of Pierre Legendre's pdf documents and puts them together.

\documentclass[10pt]{article}
\usepackage{vegan} %% vegan setup
\usepackage{pdfpages}
\setkeys{Gin}{width=0.6\linewidth}


\title{Diagrams and Procedures for Partition of Variation}
\author{Pierre Legendre}
\date{\footnotesize{
  processed with vegan \Sexpr{packageDescription("vegan", field="Version")}
  in \Sexpr{R.version.string} on \today}}

\begin{document}
%% Sweave document
\SweaveOpts{strip.white=true}
<<echo=false>>=
par(mfrow=c(1,1))
figset <- function() par(mar=c(4,4,1,1)+.1)
options(SweaveHooks = list(fig = figset))
library(vegan)
labs <- paste("Table", 1:4)
cls <- c("hotpink", "skyblue", "orange", "limegreen")
@

\maketitle

\noindent Diagrams describing the partitions of variation of a
response data table by two (Fig.~\ref{fig:part2}), three
(Fig.~\ref{fig:part3}) and four tables (Fig.~\ref{fig:part4}) of
explanatory variables. The fraction names [a] to [p] in the output of
\code{varpart} function follow the notation in these Venn diagrams,
and the diagrams were produced using the \code{showvarparts} function.
%%%%%%%%%%%%%%%
\begin{figure}[!ht]
<<echo=FALSE,fig=TRUE>>=
showvarparts(2, bg = cls, Xnames=labs)
@ 
\caption{3 regression/ canonical analyses and 3 subtraction equations
  are needed to estimate the $4\;(=2^2)$ fractions. 
  
  [a] and [c] can be tested for significance (3 canonical analyses per
  permutation). Fraction [b] cannot be tested singly.}
\label{fig:part2}
\end{figure}
%%%%%%%%%%%
\begin{figure}[!ht]
<<echo=FALSE,fig=TRUE>>=
showvarparts(3, bg = cls, Xnames=labs)
@ 
\caption{7 regression/ canonical analyses and 10 subtraction equations
  are needed to estimate the $8\;(=2^3)$ fractions. 
  
  [a] to [c] and subsets containing [a] to [c] can be tested for
  significance (4 canonical analyses per permutation to test [a] to
  [c]). Fractions [d] to [g] cannot be tested singly.}
\label{fig:part3}
\end{figure}
%%%%%%%%%%%
\begin{figure}[!ht]
<<echo=FALSE,fig=TRUE>>=
showvarparts(4, bg = cls, Xnames=labs)
@ 
\caption{15 regression/ canonical analyses and 27 subtraction equations
  are needed to estimate the $16\;(=2^4)$ fractions. 
  
  [a] to [d] and subsets containing [a] to [d] can be tested for
  significance (5 canonical analyses per permutation to test [a] to
  [d]). Fractions [e] to [o] cannot be tested singly.}
\label{fig:part4}
\end{figure}
\clearpage
\setkeys{Gin}{width=\paperwidth}
%% Add partitioning models 2-3 and 4.
\includepdf[fitpaper=true,pages=-]{varpart23.pdf}
\includepdf[fitpaper=true, pages=-]{varpart4.pdf}
\end{document}