diff --git a/inst/doc/pmc_tutorial/knit_pmc_tutorial.Rnw b/inst/doc/pmc_tutorial/knit_pmc_tutorial.Rnw index 639eaaf..acd3288 100644 --- a/inst/doc/pmc_tutorial/knit_pmc_tutorial.Rnw +++ b/inst/doc/pmc_tutorial/knit_pmc_tutorial.Rnw @@ -25,7 +25,7 @@ \newcommand{\ud}{\mathrm{d}} %% Looks like a comment but it isn't! This is setting the default behavior for the Sweave chunk options, <>= -% \SweaveOpts{fig.width=5, fig.height=5, fig.align=center} +% \SweaveOpts{fig.width=5, fig.height=5, fig.align=center, cache=TRUE, message=FALSE, warning=FALSE} @@ -81,7 +81,7 @@ sfLibrary(geiger) # export any libraries we've loaded @ Now actually running pmc takes just one line: -<>= +<>= bm_v_lambda <- pmc(geospiza.tree, geospiza.data["wingL"], "BM", "lambda", nboot=100) @ @@ -116,7 +116,7 @@ Subsetting is a good way to get the parameter of interest, lambda, for the compa (Note that for comparisons AA and AB, which fit model Brownian motion, there is of course no parameter lambda). <>= -lambdas <- subset(bm_v_lambda["par_dists"], comparison=="BB" & parameter=="lambda") +lambdas <- subset(bm_v_lambda[["par_dists"]], comparison=="BB" & parameter=="lambda") @ The returned list from pmc also stores the two models it fit to the original data, inder the names A and B. @@ -144,7 +144,7 @@ Note that the ability to estimate lambda is very poor, with most simulations ret \begin{figure} \begin{center} <>= -betas <- subset(bm_v_lambda$par_dist, comparison=="BB" & parameter=="beta") +betas <- subset(bm_v_lambda[["par_dists"]], comparison=="BB" & parameter=="beta") p2 <- ggplot(betas) + geom_histogram(aes(sqrt(value))) # beta == sigma^2 print(p2) @ @@ -153,7 +153,7 @@ print(p2) \end{figure} -We can also query the confidence intervals directly from the estimates returned by the pmc function. We can subset the data to just get the confidence interval of the parameter of interest, +We can also query the confidence intervals directly from the estimates returned by the pmc function. Using the lambda value we already extracted, we can get confidence intervals, <>= cast(lambdas, comparison ~ parameter, function(x) @@ -169,7 +169,7 @@ This way we can see the interval for lambda estimated when simulating under the \setkeys{Gin}{width=0.85\textwidth} \begin{figure} \begin{center} -<>= +<>= p3 <- plot_pars(bm_v_lambda$par_dists) print(p3) @ @@ -179,14 +179,14 @@ print(p3) % needed on linux machines to avoid stupid errors from treesim/droptip -<>= +<>= locale <- Sys.setlocale(locale="C") # clean up rm(list="locale") @ \setkeys{Gin}{width=0.45\textwidth} -<>= +<>= require(TreeSim) simtree <- sim.bd.taxa(n=281, numbsim=1, lambda=1, mu=0, frac=1, complete=FALSE, stochsampling=FALSE)[[1]][[1]] simdat <- rTraitCont(lambdaTree(simtree, .6), sigma=2) @@ -203,10 +203,10 @@ bm_v_lambda <- pmc(simtree, simdat, "BM", "lambda", nboot=20) \begin{figure} \begin{center} <>= -lambdas <- subset(bm_v_lambda$par_dist, +lambdas <- subset(bm_v_lambda[["par_dists"]], comparison=="BB" & parameter=="lambda") p4 <- ggplot(lambdas) + geom_histogram(aes(value)) + - geom_vline(xintercept=bm_v_lambda$B[[1]]$lambda) + geom_vline(xintercept=bm_v_lambda[["B"]][["wingL"]][["lambda"]]) print(p4) @ \end{center} @@ -242,7 +242,7 @@ ou0v1 <- pmc(tree, log(anoles["size"]), "brown", "hansen", \setkeys{Gin}{width=\textwidth} \begin{figure} \begin{center} -<>= +<>= a <- plot(ou3v4, A="OU.3", B="OU.4") b <- plot(ou3v15, A="OU.3", B="OU.15") c <- plot(ou1v3, A="OU.1", B="OU.3") @@ -263,7 +263,7 @@ print(d, vp = vplayout(2, 2)) Fits from the ouch methods include a phylogeny in the ouch format. As many researchers would rather manipulate and plot the resulting phylogeny in the "phylo" format from the ape package, pmc provides a simple utility to convert the tree while keeping track of the regimes in ouch. \footnote{Some caution should always be applied in using "phylo" format trees. Unlike the ouch format, a given tree does not have a unique specification, and consequently some functions that use "phylo" trees make assumptions about the ordering of edges that may not be true, even for a technically valid, plottable "phylo" specification of the phylogeny.} %\begin{figure} %\begin{center} -%<>= +%<>= %require(ape) %## Convert is a custom pmc function that toggles between tree formats %ou4_tree <- convert(tree, regimes=anoles[["OU.4"]]) @@ -278,7 +278,7 @@ Fits from the ouch methods include a phylogeny in the ouch format. As many rese We can also mix and match methods, comparing a fit from geiger with a fit from ouch. We do so in this example, which shows that it may be very difficult to identify if a given dataset comes from an early burst or a OU model, Fig~\ref{fig:eb}. -<>= +<>= ## Load Libraries ## require(pmc) require(TreeSim) # to simulate a sample phyologeny diff --git a/vignettes/pmc_tutorial.Rnw b/vignettes/pmc_tutorial.Rnw index b226a24..94b7902 100644 --- a/vignettes/pmc_tutorial.Rnw +++ b/vignettes/pmc_tutorial.Rnw @@ -365,7 +365,6 @@ \newcommand{\hlkwd}[1]{\textcolor[rgb]{0,0,0.51}{#1}} \definecolor{fgcolor}{rgb}{0,0,0} -\usepackage{tikz} \usepackage{framed} \makeatletter \newenvironment{kframe}{% @@ -448,9 +447,67 @@ The first set of examples uses the finches data and geiger functions~\citep{Harm \definecolor{shadecolor}{rgb}{.97, .97, .97}{\color{fgcolor}\begin{kframe} \begin{flushleft} \ttfamily\noindent -\hlfunctioncall{library}\hlkeyword{(}\hlsymbol{pmc}\hlkeyword{)}\hspace*{\fill}\\ -\hlstd{}\hlfunctioncall{library}\hlkeyword{(}\hlsymbol{geiger}\hlkeyword{)}{\ }{\ }\hlcomment{\usebox{\hlnormalsizeboxhash}{\ }for{\ }the{\ }data}\hspace*{\fill}\\ -\hlstd{}\hlfunctioncall{library}\hlkeyword{(}\hlsymbol{ggplot2}\hlkeyword{)}{\ }{\ }\hlcomment{\usebox{\hlnormalsizeboxhash}graphics}\hspace*{\fill}\\ +\hlfunctioncall{library}\hlkeyword{(}\hlsymbol{pmc}\hlkeyword{)}\mbox{} +\normalfont +\end{flushleft} +\begin{verbatim} +## Loading required package: ggplot2 +\end{verbatim} +\begin{verbatim} +## Loading required package: reshape +\end{verbatim} +\begin{verbatim} +## Loading required package: plyr +\end{verbatim} +\begin{verbatim} +## +## Attaching package: 'reshape' +## +\end{verbatim} +\begin{verbatim} +## The following object(s) are masked from 'package:plyr': +## +## rename, round_any +## +\end{verbatim} +\begin{verbatim} +## Loading required package: grid +\end{verbatim} +\begin{verbatim} +## Loading required package: proto +\end{verbatim} +\begin{verbatim} +## Loading required package: ouch +\end{verbatim} +\begin{verbatim} +## Loading required package: methods +\end{verbatim} +\begin{verbatim} +## Loading required package: subplex +\end{verbatim} +\begin{verbatim} +## Warning message: found an S4 version of 'simulate' so it has not been imported correctly +\end{verbatim} +\begin{flushleft} +\ttfamily\noindent +\hlfunctioncall{library}\hlkeyword{(}\hlsymbol{geiger}\hlkeyword{)}{\ }{\ }\hlcomment{\usebox{\hlnormalsizeboxhash}{\ }for{\ }the{\ }data}\mbox{} +\normalfont +\end{flushleft} +\begin{verbatim} +## Loading required package: ape +\end{verbatim} +\begin{verbatim} +## Loading required package: MASS +\end{verbatim} +\begin{verbatim} +## Loading required package: mvtnorm +\end{verbatim} +\begin{verbatim} +## Loading required package: msm +\end{verbatim} +\begin{flushleft} +\ttfamily\noindent +\hlfunctioncall{library}\hlkeyword{(}\hlsymbol{ggplot2}\hlkeyword{)}{\ }{\ }\hlcomment{\usebox{\hlnormalsizeboxhash}graphics}\hspace*{\fill}\\ \hlstd{}\hlfunctioncall{data}\hlkeyword{(}\hlsymbol{geospiza}\hlkeyword{)}\hspace*{\fill}\\ \hlstd{}\hlfunctioncall{attach}\hlkeyword{(}\hlsymbol{geospiza}\hlkeyword{)}\mbox{} \normalfont @@ -465,14 +522,28 @@ These next commands are optional, allowing the package to use the specified numb \definecolor{shadecolor}{rgb}{.97, .97, .97}{\color{fgcolor}\begin{kframe} \begin{flushleft} \ttfamily\noindent -\hlfunctioncall{require}\hlkeyword{(}\hlsymbol{snowfall}\hlkeyword{)}{\ }{\ }\hlcomment{\usebox{\hlnormalsizeboxhash}{\ }load{\ }the{\ }parallelization{\ }package}\hspace*{\fill}\\ -\hlstd{}\hlfunctioncall{sfInit}\hlkeyword{(}\hlargument{parallel}{\ }\hlargument{=}{\ }\hlsymbol{T}\hlkeyword{,}{\ }\hlargument{cpu}{\ }\hlargument{=}{\ }\hlnumber{16}\hlkeyword{)}{\ }{\ }\hlcomment{\usebox{\hlnormalsizeboxhash}{\ }specify{\ }how{\ }many{\ }cpus{\ }we{\ }have}\mbox{} +\hlfunctioncall{require}\hlkeyword{(}\hlsymbol{snowfall}\hlkeyword{)}{\ }{\ }\hlcomment{\usebox{\hlnormalsizeboxhash}{\ }load{\ }the{\ }parallelization{\ }package}\mbox{} +\normalfont +\end{flushleft} +\begin{verbatim} +## Loading required package: snowfall +\end{verbatim} +\begin{verbatim} +## Loading required package: snow +\end{verbatim} +\begin{flushleft} +\ttfamily\noindent +\hlfunctioncall{sfInit}\hlkeyword{(}\hlargument{parallel}{\ }\hlargument{=}{\ }\hlsymbol{T}\hlkeyword{,}{\ }\hlargument{cpu}{\ }\hlargument{=}{\ }\hlnumber{4}\hlkeyword{)}{\ }{\ }\hlcomment{\usebox{\hlnormalsizeboxhash}{\ }specify{\ }how{\ }many{\ }cpus{\ }we{\ }have}\mbox{} \normalfont \end{flushleft} \begin{verbatim} ## R Version: R version 2.14.1 (2011-12-22) ## \end{verbatim} +\begin{verbatim} +## snowfall 1.84 initialized (using snow 0.3-8): parallel execution on 4 CPUs. +## +\end{verbatim} \begin{flushleft} \ttfamily\noindent \hlfunctioncall{sfLibrary}\hlkeyword{(}\hlsymbol{pmc}\hlkeyword{)}\mbox{} @@ -481,6 +552,13 @@ These next commands are optional, allowing the package to use the specified numb \begin{verbatim} ## Library pmc loaded. \end{verbatim} +\begin{verbatim} +## Library pmc loaded in cluster. +## +\end{verbatim} +\begin{verbatim} +## Warning message: 'keep.source' is deprecated and will be ignored +\end{verbatim} \begin{flushleft} \ttfamily\noindent \hlfunctioncall{sfLibrary}\hlkeyword{(}\hlsymbol{geiger}\hlkeyword{)}{\ }{\ }\hlcomment{\usebox{\hlnormalsizeboxhash}{\ }export{\ }any{\ }libraries{\ }we\usebox{\hlnormalsizeboxsinglequote}ve{\ }loaded}\mbox{} @@ -489,6 +567,13 @@ These next commands are optional, allowing the package to use the specified numb \begin{verbatim} ## Library geiger loaded. \end{verbatim} +\begin{verbatim} +## Library geiger loaded in cluster. +## +\end{verbatim} +\begin{verbatim} +## Warning message: 'keep.source' is deprecated and will be ignored +\end{verbatim} \end{kframe}} \end{knitrout} @@ -497,7 +582,14 @@ Now actually running pmc takes just one line: \begin{knitrout} \definecolor{shadecolor}{rgb}{.97, .97, .97}{\color{fgcolor}\begin{kframe} \begin{verbatim} -## Error: could not find function "pmc" +## Dropped tips from the tree because there were no matching names in the data: +## [1] "olivacea" +## +## Fitting BM model: +## Dropped tips from the tree because there were no matching names in the data: +## [1] "olivacea" +## +## Fitting lambda model: \end{verbatim} \end{kframe}} \end{knitrout} @@ -575,21 +667,19 @@ We can use this to extract the value of lambda estimated on model B from the raw \definecolor{shadecolor}{rgb}{.97, .97, .97}{\color{fgcolor}\begin{kframe} \begin{flushleft} \ttfamily\noindent -\hlsymbol{p1}{\ }\hlassignement{\usebox{\hlnormalsizeboxlessthan}-}{\ }\hlfunctioncall{ggplot}\hlkeyword{(}\hlsymbol{lambdas}\hlkeyword{)}{\ }\hlkeyword{+}{\ }\hlfunctioncall{geom\usebox{\hlnormalsizeboxunderscore}histogram}\hlkeyword{(}\hlfunctioncall{aes}\hlkeyword{(}\hlsymbol{value}\hlkeyword{)}\hlkeyword{)}{\ }\hlkeyword{+}\hspace*{\fill}\\ -\hlstd{}{\ }{\ }{\ }{\ }\hlfunctioncall{geom\usebox{\hlnormalsizeboxunderscore}vline}\hlkeyword{(}\hlargument{xintercept}{\ }\hlargument{=}{\ }\hlsymbol{est}\hlkeyword{)}\mbox{} -\normalfont -\end{flushleft} -\begin{verbatim} -## Error: could not find function "ggplot" -\end{verbatim} -\begin{flushleft} -\ttfamily\noindent -\hlfunctioncall{print}\hlkeyword{(}\hlsymbol{p1}\hlkeyword{)}\mbox{} +\hlsymbol{betas}{\ }\hlassignement{\usebox{\hlnormalsizeboxlessthan}-}{\ }\hlfunctioncall{subset}\hlkeyword{(}\hlsymbol{bm\usebox{\hlnormalsizeboxunderscore}v\usebox{\hlnormalsizeboxunderscore}lambda}\hlkeyword{\usebox{\hlnormalsizeboxdollar}}\hlsymbol{par\usebox{\hlnormalsizeboxunderscore}dist}\hlkeyword{,}{\ }\hlsymbol{comparison}{\ }==\hspace*{\fill}\\ +\hlstd{}{\ }{\ }{\ }{\ }\hlstring{"{}BB"{}}{\ }\hlkeyword{\usebox{\hlnormalsizeboxand}}{\ }\hlsymbol{parameter}{\ }=={\ }\hlstring{"{}beta"{}}\hlkeyword{)}\hspace*{\fill}\\ +\hlstd{}\hlsymbol{p2}{\ }\hlassignement{\usebox{\hlnormalsizeboxlessthan}-}{\ }\hlfunctioncall{ggplot}\hlkeyword{(}\hlsymbol{betas}\hlkeyword{)}{\ }\hlkeyword{+}{\ }\hlfunctioncall{geom\usebox{\hlnormalsizeboxunderscore}histogram}\hlkeyword{(}\hlfunctioncall{aes}\hlkeyword{(}\hlfunctioncall{sqrt}\hlkeyword{(}\hlsymbol{value}\hlkeyword{)}\hlkeyword{)}\hlkeyword{)}{\ }{\ }\hlcomment{\usebox{\hlnormalsizeboxhash}{\ }beta{\ }=={\ }sigma\usebox{\hlnormalsizeboxhat}2}\hspace*{\fill}\\ +\hlstd{}\hlfunctioncall{print}\hlkeyword{(}\hlsymbol{p2}\hlkeyword{)}\mbox{} \normalfont \end{flushleft} \begin{verbatim} -## Error: object 'p1' not found +## stat_bin: binwidth defaulted to range/30. Use 'binwidth = x' to adjust this. \end{verbatim} + + +\centering{}\includegraphics{Fig1a} + \end{kframe}} \end{knitrout} @@ -607,28 +697,18 @@ Note that the ability to estimate lambda is very poor, with most simulations ret \begin{flushleft} \ttfamily\noindent \hlsymbol{betas}{\ }\hlassignement{\usebox{\hlnormalsizeboxlessthan}-}{\ }\hlfunctioncall{subset}\hlkeyword{(}\hlsymbol{bm\usebox{\hlnormalsizeboxunderscore}v\usebox{\hlnormalsizeboxunderscore}lambda}\hlkeyword{\usebox{\hlnormalsizeboxdollar}}\hlsymbol{par\usebox{\hlnormalsizeboxunderscore}dist}\hlkeyword{,}{\ }\hlsymbol{comparison}{\ }==\hspace*{\fill}\\ -\hlstd{}{\ }{\ }{\ }{\ }\hlstring{"{}BB"{}}{\ }\hlkeyword{\usebox{\hlnormalsizeboxand}}{\ }\hlsymbol{parameter}{\ }=={\ }\hlstring{"{}beta"{}}\hlkeyword{)}\mbox{} -\normalfont -\end{flushleft} -\begin{verbatim} -## Error: object 'bm_v_lambda' not found -\end{verbatim} -\begin{flushleft} -\ttfamily\noindent -\hlsymbol{p2}{\ }\hlassignement{\usebox{\hlnormalsizeboxlessthan}-}{\ }\hlfunctioncall{ggplot}\hlkeyword{(}\hlsymbol{betas}\hlkeyword{)}{\ }\hlkeyword{+}{\ }\hlfunctioncall{geom\usebox{\hlnormalsizeboxunderscore}histogram}\hlkeyword{(}\hlfunctioncall{aes}\hlkeyword{(}\hlfunctioncall{sqrt}\hlkeyword{(}\hlsymbol{value}\hlkeyword{)}\hlkeyword{)}\hlkeyword{)}{\ }{\ }\hlcomment{\usebox{\hlnormalsizeboxhash}{\ }beta{\ }=={\ }sigma\usebox{\hlnormalsizeboxhat}2}\mbox{} -\normalfont -\end{flushleft} -\begin{verbatim} -## Error: could not find function "ggplot" -\end{verbatim} -\begin{flushleft} -\ttfamily\noindent -\hlfunctioncall{print}\hlkeyword{(}\hlsymbol{p2}\hlkeyword{)}\mbox{} +\hlstd{}{\ }{\ }{\ }{\ }\hlstring{"{}BB"{}}{\ }\hlkeyword{\usebox{\hlnormalsizeboxand}}{\ }\hlsymbol{parameter}{\ }=={\ }\hlstring{"{}beta"{}}\hlkeyword{)}\hspace*{\fill}\\ +\hlstd{}\hlsymbol{p2}{\ }\hlassignement{\usebox{\hlnormalsizeboxlessthan}-}{\ }\hlfunctioncall{ggplot}\hlkeyword{(}\hlsymbol{betas}\hlkeyword{)}{\ }\hlkeyword{+}{\ }\hlfunctioncall{geom\usebox{\hlnormalsizeboxunderscore}histogram}\hlkeyword{(}\hlfunctioncall{aes}\hlkeyword{(}\hlfunctioncall{sqrt}\hlkeyword{(}\hlsymbol{value}\hlkeyword{)}\hlkeyword{)}\hlkeyword{)}{\ }{\ }\hlcomment{\usebox{\hlnormalsizeboxhash}{\ }beta{\ }=={\ }sigma\usebox{\hlnormalsizeboxhat}2}\hspace*{\fill}\\ +\hlstd{}\hlfunctioncall{print}\hlkeyword{(}\hlsymbol{p2}\hlkeyword{)}\mbox{} \normalfont \end{flushleft} \begin{verbatim} -## Error: object 'p2' not found +## stat_bin: binwidth defaulted to range/30. Use 'binwidth = x' to adjust this. \end{verbatim} + + +\centering{}\includegraphics{Fig1a} + \end{kframe}} \end{knitrout} @@ -648,7 +728,7 @@ We can also query the confidence intervals directly from the estimates returned \normalfont \end{flushleft} \begin{verbatim} -## Error: could not find function "cast" +## Error: object 'lambdas' not found \end{verbatim} \end{kframe}} \end{knitrout} @@ -665,7 +745,16 @@ Or get the intervals for all parameters at once. Note that the ``comparison'' in \normalfont \end{flushleft} \begin{verbatim} -## Error: could not find function "cast" +## comparison beta_X5. beta_X95. k_X5. k_X95. lambda_X5. lambda_X95. +## 1 AA 0.057537 0.64272 2 2 NA NA +## 2 AB 0.033484 0.38441 2 2 NA NA +## 3 BA 0.013515 0.10240 3 3 1e-07 0.9943 +## 4 BB 0.009134 0.04265 3 3 1e-07 0.9270 +## lnl_X5. lnl_X95. lr_X5. lr_X95. root_X5. root_X95. +## 1 -6.115 9.575 -6.115 9.575 4.101 4.374 +## 2 -2.772 13.087 -2.772 13.087 4.161 4.364 +## 3 1.600 13.517 1.600 13.517 4.097 4.423 +## 4 6.728 16.263 6.728 16.263 4.146 4.359 \end{verbatim} \end{kframe}} \end{knitrout} @@ -678,20 +767,14 @@ This way we can see the interval for lambda estimated when simulating under the \definecolor{shadecolor}{rgb}{.97, .97, .97}{\color{fgcolor}\begin{kframe} \begin{flushleft} \ttfamily\noindent -\hlsymbol{p3}{\ }\hlassignement{\usebox{\hlnormalsizeboxlessthan}-}{\ }\hlfunctioncall{plot\usebox{\hlnormalsizeboxunderscore}pars}\hlkeyword{(}\hlsymbol{bm\usebox{\hlnormalsizeboxunderscore}v\usebox{\hlnormalsizeboxunderscore}lambda}\hlkeyword{\usebox{\hlnormalsizeboxdollar}}\hlsymbol{par\usebox{\hlnormalsizeboxunderscore}dists}\hlkeyword{)}\mbox{} +\hlsymbol{p3}{\ }\hlassignement{\usebox{\hlnormalsizeboxlessthan}-}{\ }\hlfunctioncall{plot\usebox{\hlnormalsizeboxunderscore}pars}\hlkeyword{(}\hlsymbol{bm\usebox{\hlnormalsizeboxunderscore}v\usebox{\hlnormalsizeboxunderscore}lambda}\hlkeyword{\usebox{\hlnormalsizeboxdollar}}\hlsymbol{par\usebox{\hlnormalsizeboxunderscore}dists}\hlkeyword{)}\hspace*{\fill}\\ +\hlstd{}\hlfunctioncall{print}\hlkeyword{(}\hlsymbol{p3}\hlkeyword{)}\mbox{} \normalfont \end{flushleft} -\begin{verbatim} -## Error: could not find function "plot_pars" -\end{verbatim} -\begin{flushleft} -\ttfamily\noindent -\hlfunctioncall{print}\hlkeyword{(}\hlsymbol{p3}\hlkeyword{)}\mbox{} -\normalfont -\end{flushleft} -\begin{verbatim} -## Error: object 'p3' not found -\end{verbatim} + + +\centering{}\includegraphics{allpars} + \end{kframe}} \end{knitrout} @@ -708,10 +791,11 @@ This way we can see the interval for lambda estimated when simulating under the \begin{knitrout} \definecolor{shadecolor}{rgb}{.97, .97, .97}{\color{fgcolor}\begin{kframe} \begin{verbatim} -## Error: $ operator is invalid for atomic vectors +## Loading required package: TreeSim \end{verbatim} \begin{verbatim} -## Error: could not find function "pmc" +## Fitting BM model: +## Fitting lambda model: \end{verbatim} \end{kframe}} \end{knitrout} @@ -763,47 +847,23 @@ Next we consider the examples re-analyzing the Anoles data from~\citep{Butler200 \hlstd{}\hlsymbol{ou3v4}{\ }\hlassignement{\usebox{\hlnormalsizeboxlessthan}-}{\ }\hlfunctioncall{pmc}\hlkeyword{(}\hlsymbol{tree}\hlkeyword{,}{\ }\hlfunctioncall{log}\hlkeyword{(}\hlsymbol{anoles}\hlkeyword{[}\hlstring{"{}size"{}}\hlkeyword{]}\hlkeyword{)}\hlkeyword{,}{\ }\hlargument{modelA}{\ }\hlargument{=}{\ }\hlstring{"{}hansen"{}}\hlkeyword{,}\hspace*{\fill}\\ \hlstd{}{\ }{\ }{\ }{\ }\hlargument{modelB}{\ }\hlargument{=}{\ }\hlstring{"{}hansen"{}}\hlkeyword{,}{\ }\hlargument{optionsA}{\ }\hlargument{=}{\ }\hlfunctioncall{list}\hlkeyword{(}\hlargument{regimes}{\ }\hlargument{=}{\ }\hlsymbol{anoles}\hlkeyword{[}\hlstring{"{}OU.LP"{}}\hlkeyword{]}\hlkeyword{,}\hspace*{\fill}\\ \hlstd{}{\ }{\ }{\ }{\ }{\ }{\ }{\ }{\ }\hlargument{sqrt.alpha}{\ }\hlargument{=}{\ }\hlnumber{1}\hlkeyword{,}{\ }\hlargument{sigma}{\ }\hlargument{=}{\ }\hlnumber{1}\hlkeyword{)}\hlkeyword{,}{\ }\hlargument{optionsB}{\ }\hlargument{=}{\ }\hlfunctioncall{list}\hlkeyword{(}\hlargument{regimes}{\ }\hlargument{=}{\ }\hlsymbol{anoles}\hlkeyword{[}\hlstring{"{}OU.4"{}}\hlkeyword{]}\hlkeyword{,}\hspace*{\fill}\\ -\hlstd{}{\ }{\ }{\ }{\ }{\ }{\ }{\ }{\ }\hlargument{sqrt.alpha}{\ }\hlargument{=}{\ }\hlnumber{1}\hlkeyword{,}{\ }\hlargument{sigma}{\ }\hlargument{=}{\ }\hlnumber{1}\hlkeyword{)}\hlkeyword{,}{\ }\hlargument{nboot}{\ }\hlargument{=}{\ }\hlnumber{100}\hlkeyword{)}\mbox{} -\normalfont -\end{flushleft} -\begin{verbatim} -## Error: could not find function "pmc" -\end{verbatim} -\begin{flushleft} -\ttfamily\noindent -\hspace*{\fill}\\ +\hlstd{}{\ }{\ }{\ }{\ }{\ }{\ }{\ }{\ }\hlargument{sqrt.alpha}{\ }\hlargument{=}{\ }\hlnumber{1}\hlkeyword{,}{\ }\hlargument{sigma}{\ }\hlargument{=}{\ }\hlnumber{1}\hlkeyword{)}\hlkeyword{,}{\ }\hlargument{nboot}{\ }\hlargument{=}{\ }\hlnumber{100}\hlkeyword{)}\hspace*{\fill}\\ +\hlstd{}\hspace*{\fill}\\ \hlstd{}\hlsymbol{ou3v15}{\ }\hlassignement{\usebox{\hlnormalsizeboxlessthan}-}{\ }\hlfunctioncall{pmc}\hlkeyword{(}\hlsymbol{tree}\hlkeyword{,}{\ }\hlfunctioncall{log}\hlkeyword{(}\hlsymbol{anoles}\hlkeyword{[}\hlstring{"{}size"{}}\hlkeyword{]}\hlkeyword{)}\hlkeyword{,}{\ }\hlstring{"{}hansen"{}}\hlkeyword{,}\hspace*{\fill}\\ \hlstd{}{\ }{\ }{\ }{\ }\hlstring{"{}hansen"{}}\hlkeyword{,}{\ }\hlfunctioncall{list}\hlkeyword{(}\hlargument{regimes}{\ }\hlargument{=}{\ }\hlsymbol{anoles}\hlkeyword{[}\hlstring{"{}OU.LP"{}}\hlkeyword{]}\hlkeyword{,}{\ }\hlargument{sqrt.alpha}{\ }\hlargument{=}{\ }\hlnumber{1}\hlkeyword{,}\hspace*{\fill}\\ \hlstd{}{\ }{\ }{\ }{\ }{\ }{\ }{\ }{\ }\hlargument{sigma}{\ }\hlargument{=}{\ }\hlnumber{1}\hlkeyword{)}\hlkeyword{,}{\ }\hlfunctioncall{list}\hlkeyword{(}\hlargument{regimes}{\ }\hlargument{=}{\ }\hlsymbol{anoles}\hlkeyword{[}\hlstring{"{}OU.15"{}}\hlkeyword{]}\hlkeyword{,}{\ }\hlargument{sqrt.alpha}{\ }\hlargument{=}{\ }\hlnumber{1}\hlkeyword{,}\hspace*{\fill}\\ -\hlstd{}{\ }{\ }{\ }{\ }{\ }{\ }{\ }{\ }\hlargument{sigma}{\ }\hlargument{=}{\ }\hlnumber{1}\hlkeyword{)}\hlkeyword{,}{\ }\hlargument{nboot}{\ }\hlargument{=}{\ }\hlnumber{100}\hlkeyword{)}\mbox{} -\normalfont -\end{flushleft} -\begin{verbatim} -## Error: could not find function "pmc" -\end{verbatim} -\begin{flushleft} -\ttfamily\noindent -\hspace*{\fill}\\ +\hlstd{}{\ }{\ }{\ }{\ }{\ }{\ }{\ }{\ }\hlargument{sigma}{\ }\hlargument{=}{\ }\hlnumber{1}\hlkeyword{)}\hlkeyword{,}{\ }\hlargument{nboot}{\ }\hlargument{=}{\ }\hlnumber{100}\hlkeyword{)}\hspace*{\fill}\\ +\hlstd{}\hspace*{\fill}\\ \hlstd{}\hlsymbol{ou1v3}{\ }\hlassignement{\usebox{\hlnormalsizeboxlessthan}-}{\ }\hlfunctioncall{pmc}\hlkeyword{(}\hlsymbol{tree}\hlkeyword{,}{\ }\hlfunctioncall{log}\hlkeyword{(}\hlsymbol{anoles}\hlkeyword{[}\hlstring{"{}size"{}}\hlkeyword{]}\hlkeyword{)}\hlkeyword{,}{\ }\hlstring{"{}hansen"{}}\hlkeyword{,}\hspace*{\fill}\\ \hlstd{}{\ }{\ }{\ }{\ }\hlstring{"{}hansen"{}}\hlkeyword{,}{\ }\hlfunctioncall{list}\hlkeyword{(}\hlargument{regimes}{\ }\hlargument{=}{\ }\hlsymbol{anoles}\hlkeyword{[}\hlstring{"{}OU.1"{}}\hlkeyword{]}\hlkeyword{,}{\ }\hlargument{sqrt.alpha}{\ }\hlargument{=}{\ }\hlnumber{1}\hlkeyword{,}\hspace*{\fill}\\ \hlstd{}{\ }{\ }{\ }{\ }{\ }{\ }{\ }{\ }\hlargument{sigma}{\ }\hlargument{=}{\ }\hlnumber{1}\hlkeyword{)}\hlkeyword{,}{\ }\hlfunctioncall{list}\hlkeyword{(}\hlargument{regimes}{\ }\hlargument{=}{\ }\hlsymbol{anoles}\hlkeyword{[}\hlstring{"{}OU.LP"{}}\hlkeyword{]}\hlkeyword{,}{\ }\hlargument{sqrt.alpha}{\ }\hlargument{=}{\ }\hlnumber{1}\hlkeyword{,}\hspace*{\fill}\\ -\hlstd{}{\ }{\ }{\ }{\ }{\ }{\ }{\ }{\ }\hlargument{sigma}{\ }\hlargument{=}{\ }\hlnumber{1}\hlkeyword{)}\hlkeyword{,}{\ }\hlargument{nboot}{\ }\hlargument{=}{\ }\hlnumber{100}\hlkeyword{)}\mbox{} -\normalfont -\end{flushleft} -\begin{verbatim} -## Error: could not find function "pmc" -\end{verbatim} -\begin{flushleft} -\ttfamily\noindent -\hspace*{\fill}\\ +\hlstd{}{\ }{\ }{\ }{\ }{\ }{\ }{\ }{\ }\hlargument{sigma}{\ }\hlargument{=}{\ }\hlnumber{1}\hlkeyword{)}\hlkeyword{,}{\ }\hlargument{nboot}{\ }\hlargument{=}{\ }\hlnumber{100}\hlkeyword{)}\hspace*{\fill}\\ +\hlstd{}\hspace*{\fill}\\ \hlstd{}\hlsymbol{ou0v1}{\ }\hlassignement{\usebox{\hlnormalsizeboxlessthan}-}{\ }\hlfunctioncall{pmc}\hlkeyword{(}\hlsymbol{tree}\hlkeyword{,}{\ }\hlfunctioncall{log}\hlkeyword{(}\hlsymbol{anoles}\hlkeyword{[}\hlstring{"{}size"{}}\hlkeyword{]}\hlkeyword{)}\hlkeyword{,}{\ }\hlstring{"{}brown"{}}\hlkeyword{,}\hspace*{\fill}\\ \hlstd{}{\ }{\ }{\ }{\ }\hlstring{"{}hansen"{}}\hlkeyword{,}{\ }\hlfunctioncall{list}\hlkeyword{(}\hlkeyword{)}\hlkeyword{,}{\ }\hlfunctioncall{list}\hlkeyword{(}\hlargument{regimes}{\ }\hlargument{=}{\ }\hlsymbol{anoles}\hlkeyword{[}\hlstring{"{}OU.1"{}}\hlkeyword{]}\hlkeyword{,}{\ }\hlargument{sqrt.alpha}{\ }\hlargument{=}{\ }\hlnumber{1}\hlkeyword{,}\hspace*{\fill}\\ \hlstd{}{\ }{\ }{\ }{\ }{\ }{\ }{\ }{\ }\hlargument{sigma}{\ }\hlargument{=}{\ }\hlnumber{1}\hlkeyword{)}\hlkeyword{,}{\ }\hlargument{nboot}{\ }\hlargument{=}{\ }\hlnumber{100}\hlkeyword{)}\mbox{} \normalfont \end{flushleft} -\begin{verbatim} -## Error: could not find function "pmc" -\end{verbatim} \end{kframe}} \end{knitrout} @@ -820,8 +880,7 @@ Next we consider the examples re-analyzing the Anoles data from~\citep{Butler200 \normalfont \end{flushleft} \begin{verbatim} -## Error: error in evaluating the argument 'x' in selecting a method for function 'plot': Error: object 'ou3v4' not found -## +## Using as id variables \end{verbatim} \begin{flushleft} \ttfamily\noindent @@ -829,8 +888,7 @@ Next we consider the examples re-analyzing the Anoles data from~\citep{Butler200 \normalfont \end{flushleft} \begin{verbatim} -## Error: error in evaluating the argument 'x' in selecting a method for function 'plot': Error: object 'ou3v15' not found -## +## Using as id variables \end{verbatim} \begin{flushleft} \ttfamily\noindent @@ -838,8 +896,7 @@ Next we consider the examples re-analyzing the Anoles data from~\citep{Butler200 \normalfont \end{flushleft} \begin{verbatim} -## Error: error in evaluating the argument 'x' in selecting a method for function 'plot': Error: object 'ou1v3' not found -## +## Using as id variables \end{verbatim} \begin{flushleft} \ttfamily\noindent @@ -847,64 +904,26 @@ Next we consider the examples re-analyzing the Anoles data from~\citep{Butler200 \normalfont \end{flushleft} \begin{verbatim} -## Error: error in evaluating the argument 'x' in selecting a method for function 'plot': Error: object 'ou0v1' not found -## +## Using as id variables \end{verbatim} \begin{flushleft} \ttfamily\noindent \hspace*{\fill}\\ -\hlstd{}\hlfunctioncall{grid.newpage}\hlkeyword{(}\hlkeyword{)}\mbox{} -\normalfont -\end{flushleft} -\begin{verbatim} -## Error: could not find function "grid.newpage" -\end{verbatim} -\begin{flushleft} -\ttfamily\noindent -\hlfunctioncall{pushViewport}\hlkeyword{(}\hlfunctioncall{viewport}\hlkeyword{(}\hlargument{layout}{\ }\hlargument{=}{\ }\hlfunctioncall{grid.layout}\hlkeyword{(}\hlnumber{2}\hlkeyword{,}\hspace*{\fill}\\ -\hlstd{}{\ }{\ }{\ }{\ }\hlnumber{2}\hlkeyword{)}\hlkeyword{)}\hlkeyword{)}\mbox{} -\normalfont -\end{flushleft} -\begin{verbatim} -## Error: could not find function "pushViewport" -\end{verbatim} -\begin{flushleft} -\ttfamily\noindent -\hlsymbol{vplayout}{\ }\hlassignement{\usebox{\hlnormalsizeboxlessthan}-}{\ }\hlkeyword{function}\hlkeyword{(}\hlformalargs{x}\hlkeyword{,}{\ }\hlformalargs{y}\hlkeyword{)}{\ }\hlfunctioncall{viewport}\hlkeyword{(}\hlargument{layout.pos.row}{\ }\hlargument{=}{\ }\hlsymbol{x}\hlkeyword{,}\hspace*{\fill}\\ +\hlstd{}\hlfunctioncall{grid.newpage}\hlkeyword{(}\hlkeyword{)}\hspace*{\fill}\\ +\hlstd{}\hlfunctioncall{pushViewport}\hlkeyword{(}\hlfunctioncall{viewport}\hlkeyword{(}\hlargument{layout}{\ }\hlargument{=}{\ }\hlfunctioncall{grid.layout}\hlkeyword{(}\hlnumber{2}\hlkeyword{,}\hspace*{\fill}\\ +\hlstd{}{\ }{\ }{\ }{\ }\hlnumber{2}\hlkeyword{)}\hlkeyword{)}\hlkeyword{)}\hspace*{\fill}\\ +\hlstd{}\hlsymbol{vplayout}{\ }\hlassignement{\usebox{\hlnormalsizeboxlessthan}-}{\ }\hlkeyword{function}\hlkeyword{(}\hlformalargs{x}\hlkeyword{,}{\ }\hlformalargs{y}\hlkeyword{)}{\ }\hlfunctioncall{viewport}\hlkeyword{(}\hlargument{layout.pos.row}{\ }\hlargument{=}{\ }\hlsymbol{x}\hlkeyword{,}\hspace*{\fill}\\ \hlstd{}{\ }{\ }{\ }{\ }\hlargument{layout.pos.col}{\ }\hlargument{=}{\ }\hlsymbol{y}\hlkeyword{)}\hspace*{\fill}\\ -\hlstd{}\hlfunctioncall{print}\hlkeyword{(}\hlsymbol{a}\hlkeyword{,}{\ }\hlargument{vp}{\ }\hlargument{=}{\ }\hlfunctioncall{vplayout}\hlkeyword{(}\hlnumber{1}\hlkeyword{,}{\ }\hlnumber{1}\hlkeyword{)}\hlkeyword{)}\mbox{} -\normalfont -\end{flushleft} -\begin{verbatim} -## Error: error in evaluating the argument 'x' in selecting a method for function 'print': Error: object 'a' not found -## -\end{verbatim} -\begin{flushleft} -\ttfamily\noindent -\hlfunctioncall{print}\hlkeyword{(}\hlsymbol{b}\hlkeyword{,}{\ }\hlargument{vp}{\ }\hlargument{=}{\ }\hlfunctioncall{vplayout}\hlkeyword{(}\hlnumber{1}\hlkeyword{,}{\ }\hlnumber{2}\hlkeyword{)}\hlkeyword{)}\mbox{} +\hlstd{}\hlfunctioncall{print}\hlkeyword{(}\hlsymbol{a}\hlkeyword{,}{\ }\hlargument{vp}{\ }\hlargument{=}{\ }\hlfunctioncall{vplayout}\hlkeyword{(}\hlnumber{1}\hlkeyword{,}{\ }\hlnumber{1}\hlkeyword{)}\hlkeyword{)}\hspace*{\fill}\\ +\hlstd{}\hlfunctioncall{print}\hlkeyword{(}\hlsymbol{b}\hlkeyword{,}{\ }\hlargument{vp}{\ }\hlargument{=}{\ }\hlfunctioncall{vplayout}\hlkeyword{(}\hlnumber{1}\hlkeyword{,}{\ }\hlnumber{2}\hlkeyword{)}\hlkeyword{)}\hspace*{\fill}\\ +\hlstd{}\hlfunctioncall{print}\hlkeyword{(}\hlsymbol{c}\hlkeyword{,}{\ }\hlargument{vp}{\ }\hlargument{=}{\ }\hlfunctioncall{vplayout}\hlkeyword{(}\hlnumber{2}\hlkeyword{,}{\ }\hlnumber{1}\hlkeyword{)}\hlkeyword{)}\hspace*{\fill}\\ +\hlstd{}\hlfunctioncall{print}\hlkeyword{(}\hlsymbol{d}\hlkeyword{,}{\ }\hlargument{vp}{\ }\hlargument{=}{\ }\hlfunctioncall{vplayout}\hlkeyword{(}\hlnumber{2}\hlkeyword{,}{\ }\hlnumber{2}\hlkeyword{)}\hlkeyword{)}\mbox{} \normalfont \end{flushleft} -\begin{verbatim} -## Error: error in evaluating the argument 'x' in selecting a method for function 'print': Error: object 'b' not found -## -\end{verbatim} -\begin{flushleft} -\ttfamily\noindent -\hlfunctioncall{print}\hlkeyword{(}\hlsymbol{c}\hlkeyword{,}{\ }\hlargument{vp}{\ }\hlargument{=}{\ }\hlfunctioncall{vplayout}\hlkeyword{(}\hlnumber{2}\hlkeyword{,}{\ }\hlnumber{1}\hlkeyword{)}\hlkeyword{)}\mbox{} -\normalfont -\end{flushleft} -\begin{verbatim} -## Error: could not find function "viewport" -\end{verbatim} -\begin{flushleft} -\ttfamily\noindent -\hlfunctioncall{print}\hlkeyword{(}\hlsymbol{d}\hlkeyword{,}{\ }\hlargument{vp}{\ }\hlargument{=}{\ }\hlfunctioncall{vplayout}\hlkeyword{(}\hlnumber{2}\hlkeyword{,}{\ }\hlnumber{2}\hlkeyword{)}\hlkeyword{)}\mbox{} -\normalfont -\end{flushleft} -\begin{verbatim} -## Error: error in evaluating the argument 'x' in selecting a method for function 'print': Error: object 'd' not found -## -\end{verbatim} + + +\centering{}\includegraphics{plot_anoles} + \end{kframe}} \end{knitrout} @@ -933,13 +952,13 @@ We can also mix and match methods, comparing a fit from geiger with a fit from o \begin{knitrout} \definecolor{shadecolor}{rgb}{.97, .97, .97}{\color{fgcolor}\begin{kframe} \begin{verbatim} -## Error: object "phy" is not of class "phylo" +## traits ouch-formatted as data.frame \end{verbatim} \begin{verbatim} -## Error: Problem with tree format +## Fitting EB model: \end{verbatim} \begin{verbatim} -## Error: object 'dat' not found +## traits ouch-formatted as data.frame \end{verbatim} \end{kframe}} \end{knitrout} @@ -974,8 +993,12 @@ We can also mix and match methods, comparing a fit from geiger with a fit from o \normalfont \end{flushleft} \begin{verbatim} -## Error: object 'eb_v_ou' not found +## Using as id variables \end{verbatim} + + +\centering{}\includegraphics{earlyburst_fig} + \end{kframe}} \end{knitrout} @@ -992,16 +1015,13 @@ To implement the pmc package over a variety of methods, I have written an abstra \normalfont \end{flushleft} \begin{verbatim} -## Error: could not find function "format_data" +## traits ouch-formatted as data.frame \end{verbatim} \begin{flushleft} \ttfamily\noindent \hlsymbol{ape}{\ }\hlassignement{\usebox{\hlnormalsizeboxlessthan}-}{\ }\hlfunctioncall{format\usebox{\hlnormalsizeboxunderscore}data}\hlkeyword{(}\hlsymbol{ouch}\hlkeyword{\usebox{\hlnormalsizeboxdollar}}\hlsymbol{tree}\hlkeyword{,}{\ }\hlsymbol{ouch}\hlkeyword{\usebox{\hlnormalsizeboxdollar}}\hlsymbol{dat}\hlkeyword{)}\mbox{} \normalfont \end{flushleft} -\begin{verbatim} -## Error: could not find function "format_data" -\end{verbatim} \end{kframe}} \end{knitrout} @@ -1015,7 +1035,7 @@ This format swapping is handled automatically in pmc's generic function for fitt \normalfont \end{flushleft} \begin{verbatim} -## Error: could not find function "pmc_fit" +## Fitting BM model: \end{verbatim} \begin{flushleft} \ttfamily\noindent @@ -1024,7 +1044,7 @@ This format swapping is handled automatically in pmc's generic function for fitt \normalfont \end{flushleft} \begin{verbatim} -## Error: could not find function "pmc_fit" +## traits ouch-formatted as data.frame \end{verbatim} \end{kframe}} \end{knitrout} @@ -1034,19 +1054,12 @@ This function also returns an object of a class that matches the fitting method \definecolor{shadecolor}{rgb}{.97, .97, .97}{\color{fgcolor}\begin{kframe} \begin{flushleft} \ttfamily\noindent -\hlsymbol{sim}{\ }\hlassignement{\usebox{\hlnormalsizeboxlessthan}-}{\ }\hlfunctioncall{simulate}\hlkeyword{(}\hlsymbol{A}\hlkeyword{)}\mbox{} +\hlsymbol{sim}{\ }\hlassignement{\usebox{\hlnormalsizeboxlessthan}-}{\ }\hlfunctioncall{simulate}\hlkeyword{(}\hlsymbol{A}\hlkeyword{)}\hspace*{\fill}\\ +\hlstd{}\hlsymbol{newA}{\ }\hlassignement{\usebox{\hlnormalsizeboxlessthan}-}{\ }\hlfunctioncall{update}\hlkeyword{(}\hlsymbol{A}\hlkeyword{,}{\ }\hlfunctioncall{simulate}\hlkeyword{(}\hlsymbol{A}\hlkeyword{)}\hlkeyword{)}\mbox{} \normalfont \end{flushleft} \begin{verbatim} -## Error: object 'A' not found -\end{verbatim} -\begin{flushleft} -\ttfamily\noindent -\hlsymbol{newA}{\ }\hlassignement{\usebox{\hlnormalsizeboxlessthan}-}{\ }\hlfunctioncall{update}\hlkeyword{(}\hlsymbol{A}\hlkeyword{,}{\ }\hlfunctioncall{simulate}\hlkeyword{(}\hlsymbol{A}\hlkeyword{)}\hlkeyword{)}\mbox{} -\normalfont -\end{flushleft} -\begin{verbatim} -## Error: object 'A' not found +## Fitting BM model: \end{verbatim} \end{kframe}} \end{knitrout} @@ -1079,7 +1092,114 @@ A seperate function, \texttt{treepower}, creates the power curves in Figure 6 of \normalfont \end{flushleft} \begin{verbatim} -## Error: 'tree' must be of class 'phylo' +## Explicit sfStop() is missing: stop now. +\end{verbatim} +\begin{verbatim} +## +## Stopping cluster +## +\end{verbatim} +\begin{verbatim} +## snowfall 1.84 initialized (using snow 0.3-8): parallel execution on 4 CPUs. +## +\end{verbatim} +\begin{verbatim} +## Library pmc loaded. +\end{verbatim} +\begin{verbatim} +## Library pmc loaded in cluster. +## +\end{verbatim} +\begin{verbatim} +## Warning message: 'keep.source' is deprecated and will be ignored +\end{verbatim} +\begin{verbatim} +## Explicit sfStop() is missing: stop now. +\end{verbatim} +\begin{verbatim} +## +## Stopping cluster +## +\end{verbatim} +\begin{verbatim} +## snowfall 1.84 initialized (using snow 0.3-8): parallel execution on 4 CPUs. +## +\end{verbatim} +\begin{verbatim} +## Library pmc loaded. +\end{verbatim} +\begin{verbatim} +## Library pmc loaded in cluster. +## +\end{verbatim} +\begin{verbatim} +## Warning message: 'keep.source' is deprecated and will be ignored +\end{verbatim} +\begin{verbatim} +## Explicit sfStop() is missing: stop now. +\end{verbatim} +\begin{verbatim} +## +## Stopping cluster +## +\end{verbatim} +\begin{verbatim} +## snowfall 1.84 initialized (using snow 0.3-8): parallel execution on 4 CPUs. +## +\end{verbatim} +\begin{verbatim} +## Library pmc loaded. +\end{verbatim} +\begin{verbatim} +## Library pmc loaded in cluster. +## +\end{verbatim} +\begin{verbatim} +## Warning message: 'keep.source' is deprecated and will be ignored +\end{verbatim} +\begin{verbatim} +## Explicit sfStop() is missing: stop now. +\end{verbatim} +\begin{verbatim} +## +## Stopping cluster +## +\end{verbatim} +\begin{verbatim} +## snowfall 1.84 initialized (using snow 0.3-8): parallel execution on 4 CPUs. +## +\end{verbatim} +\begin{verbatim} +## Library pmc loaded. +\end{verbatim} +\begin{verbatim} +## Library pmc loaded in cluster. +## +\end{verbatim} +\begin{verbatim} +## Warning message: 'keep.source' is deprecated and will be ignored +\end{verbatim} +\begin{verbatim} +## Explicit sfStop() is missing: stop now. +\end{verbatim} +\begin{verbatim} +## +## Stopping cluster +## +\end{verbatim} +\begin{verbatim} +## snowfall 1.84 initialized (using snow 0.3-8): parallel execution on 4 CPUs. +## +\end{verbatim} +\begin{verbatim} +## Library pmc loaded. +\end{verbatim} +\begin{verbatim} +## Library pmc loaded in cluster. +## +\end{verbatim} +\begin{verbatim} +## Warning message: 'keep.source' is deprecated and will be ignored \end{verbatim} \begin{flushleft} \ttfamily\noindent @@ -1095,7 +1215,92 @@ A seperate function, \texttt{treepower}, creates the power curves in Figure 6 of \normalfont \end{flushleft} \begin{verbatim} -## Error: $ operator is invalid for atomic vectors +## Explicit sfStop() is missing: stop now. +\end{verbatim} +\begin{verbatim} +## +## Stopping cluster +## +\end{verbatim} +\begin{verbatim} +## snowfall 1.84 initialized (using snow 0.3-8): parallel execution on 4 CPUs. +## +\end{verbatim} +\begin{verbatim} +## Library pmc loaded. +\end{verbatim} +\begin{verbatim} +## Library pmc loaded in cluster. +## +\end{verbatim} +\begin{verbatim} +## Warning message: 'keep.source' is deprecated and will be ignored +\end{verbatim} +\begin{verbatim} +## Explicit sfStop() is missing: stop now. +\end{verbatim} +\begin{verbatim} +## +## Stopping cluster +## +\end{verbatim} +\begin{verbatim} +## snowfall 1.84 initialized (using snow 0.3-8): parallel execution on 4 CPUs. +## +\end{verbatim} +\begin{verbatim} +## Library pmc loaded. +\end{verbatim} +\begin{verbatim} +## Library pmc loaded in cluster. +## +\end{verbatim} +\begin{verbatim} +## Warning message: 'keep.source' is deprecated and will be ignored +\end{verbatim} +\begin{verbatim} +## Explicit sfStop() is missing: stop now. +\end{verbatim} +\begin{verbatim} +## +## Stopping cluster +## +\end{verbatim} +\begin{verbatim} +## snowfall 1.84 initialized (using snow 0.3-8): parallel execution on 4 CPUs. +## +\end{verbatim} +\begin{verbatim} +## Library pmc loaded. +\end{verbatim} +\begin{verbatim} +## Library pmc loaded in cluster. +## +\end{verbatim} +\begin{verbatim} +## Warning message: 'keep.source' is deprecated and will be ignored +\end{verbatim} +\begin{verbatim} +## Explicit sfStop() is missing: stop now. +\end{verbatim} +\begin{verbatim} +## +## Stopping cluster +## +\end{verbatim} +\begin{verbatim} +## snowfall 1.84 initialized (using snow 0.3-8): parallel execution on 4 CPUs. +## +\end{verbatim} +\begin{verbatim} +## Library pmc loaded. +\end{verbatim} +\begin{verbatim} +## Library pmc loaded in cluster. +## +\end{verbatim} +\begin{verbatim} +## Warning message: 'keep.source' is deprecated and will be ignored \end{verbatim} \end{kframe}} \end{knitrout} @@ -1129,9 +1334,6 @@ A seperate function, \texttt{treepower}, creates the power curves in Figure 6 of \centering{}\includegraphics{Fig6a} -\begin{verbatim} -## Error: object 'size' not found -\end{verbatim} \end{kframe}} \end{knitrout} @@ -1169,9 +1371,6 @@ A seperate function, \texttt{treepower}, creates the power curves in Figure 6 of \centering{}\includegraphics{Fig6b} -\begin{verbatim} -## Error: object 'shape' not found -\end{verbatim} \end{kframe}} \end{knitrout} diff --git a/vignettes/pmc_tutorial.bib b/vignettes/pmc_tutorial.bib index e69de29..694f596 100644 --- a/vignettes/pmc_tutorial.bib +++ b/vignettes/pmc_tutorial.bib @@ -0,0 +1,63 @@ + +@Article{ butler2004, + abstract = {Biologists employ phylogenetic comparative methods to + study adaptive evolution. However, none of the popular + methods model selection directly.We explain and develop a + method based on the Ornstein-Uhlenbeck (OU) process, first + proposed by Hansen. Ornstein-Uhlenbeck models incorporate + both selection and drift and are thus qualitatively + different from, and more general than, pure drift models + based on Brownian motion. Most importantly,OU models + possess selective optima that formalize the notion of + adaptive zone. In this article, we develop the method for + one quantitative character, discuss interpretations of its + parameters, and provide code implementing the method. Our + approach allows us to translate hy- potheses regarding + adaptation in different selective regimes into ex- plicit + models, to test the models against data using maximum-like- + lihood-based model selection techniques, and to infer + details of the evolutionary process. We illustrate the + method using two worked examples. Relative to existing + approaches, the direct modeling ap- proach we demonstrate + allows one to explore more detailed hy- potheses and to + utilize more of the information content of com- parative + data sets than existing methods. Moreover, the use of a + model selection framework to simultaneously compare a + variety of hy- potheses advances our ability to assess + alternative evolutionary explanations.}, + author = {Butler, Marguerite A. and King, Aaron A.}, + doi = {10.1086/426002}, + file = {:home/cboettig/Documents/Mendeley//Butler, King - 2004 - + The American + Naturalist.pdf:pdf;:home/cboettig/Documents/Mendeley/Butler, + King - 2004 - The American Naturalist(2).pdf:pdf}, + issn = {0003-0147}, + journal = {The American Naturalist}, + keywords = {Anolis lizards,Brownian + motion,Ornstein-Uhlenbeck,adaptation,evolutionary + model,selective regime}, + month = dec, + number = {6}, + pages = {683--695}, + title = {{Phylogenetic Comparative Analysis: A Modeling Approach + for Adaptive Evolution}}, + url = {http://www.jstor.org/stable/10.1086/426002}, + volume = {164}, + year = {2004} +} + +@Article{ harmon2008, + author = {Harmon, Luke J and Weir, Jason T and Brock, Chad D and + Glor, Richard E and Challenger, Wendell}, + doi = {10.1093/bioinformatics/btm538}, + file = {:home/cboettig/Documents/Mendeley//Harmon et al. - 2008 - + Bioinformatics.pdf:pdf}, + journal = {Bioinformatics}, + keywords = {evolution,phylogenetics}, + mendeley-tags = {evolution,phylogenetics}, + number = {1}, + pages = {129--131}, + title = {{Geiger: investigating evolutionary radiations}}, + volume = {24}, + year = {2008} +}