README
stevens.etal.2011.FiCP.zip

Created on 4 Apr 2011 by Jeffrey R. Stevens (jeffrey.r.stevens@gmail.com)

This folder (stevens.etal.2011.FiCP.zip) contains all of the files required to analyze the data and generate the manuscript for the following paper:
Mühlhoff, N., Stevens, J.R., & Reader, S.M. (2011). Spatial discounting of food and social rewards in guppies (Poecilia reticulata). Frontiers in Psychology, 2, 68.

%%%%%%%%%%%%%%%%%%%%%%%%%%
Files
%%%%%%%%%%%%%%%%%%%%%%%%%%

fishdisc.bib - database of references for bibliography
muehlhoff.etal.2011.FiCP.pdf - final published version of manuscript
muehlhoff.etal.2011.FiCP.Rnw - LaTeX document of manuscript with embedded R code
muehlhoff.etal.2011.FiCP.tex - LaTeX document of manuscript after compiling R code
muehlhoff.etal.inpress.FiCP.pdf - PDF of manuscript generated by compiling ms.Rnw or ms.tex

figures directory - contains PDF files of Figures 1 and 2.

Rwork directory
muehlhoff.etal.2011.FiCP_rcode.pdf - PDF of R code used to analyze data and produce graphs
muehlhoff.etal.2011.FiCP_rcode.R - R code used to analyze data and produce graphs
data directory - contains data files
figures directory - R code places generated figures here


%%%%%%%%%%%%%%%%%%%%%%%%%%
Instructions
%%%%%%%%%%%%%%%%%%%%%%%%%%

To run the R script independently, see instructions in muehlhoff.etal.2011.FiCP_rcode.R.

To compile the LaTeX document and R script together, start R and set the working directory to the directory that includes muehlhoff.etal.2011.FiCP.Rnw.  At the R command prompt, type:
> Sweave("muehlhoff.etal.2011.FiCP.Rnw")
This will generate muehlhoff.etal.2011.FiCP.tex.  This can be compiled with bibtex and latex or pdflatex to generate the DVI or PDF version.

Alternatively, open muehlhoff.etal.2011.FiCP.Rnw in Rstudio (http://www.rstudio.org) and use the CompilePDF function.

