#LyX 2.3 created this file. For more info see http://www.lyx.org/
\lyxformat 544
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass extarticle
\begin_preamble
\usepackage[includehead, includefoot,
lmargin=1in,
rmargin=1in,
tmargin=0.75in,
bmargin=1.0in,
headheight=0pt,
headsep=0pt,
marginparwidth=0pt,
footskip=1.5\baselineskip,
]{geometry}

%\usepackage{dcolumn}
%\usepackage{booktabs}

\input{theme/guidePreambleHeader.tex}
\input{theme/preambleFooter.tex}
\input{theme/guidePreambleKnitr.tex}
\end_preamble
\use_default_options false
\begin_modules
logicalmkup
knitr
natbibapa
\end_modules
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding utf8
\fontencoding global
\font_roman "lmodern" "default"
\font_sans "lmss" "default"
\font_typewriter "lmtt" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\use_microtype false
\use_dash_ligatures true
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize 11
\spacing single
\use_hyperref true
\pdf_bookmarks true
\pdf_bookmarksnumbered false
\pdf_bookmarksopen false
\pdf_bookmarksopenlevel 1
\pdf_breaklinks true
\pdf_pdfborder true
\pdf_colorlinks true
\pdf_backref false
\pdf_pdfusetitle true
\papersize letterpaper
\use_geometry false
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 0
\use_package esint 1
\use_package mathdots 0
\use_package mathtools 0
\use_package mhchem 0
\use_package stackrel 0
\use_package stmaryrd 0
\use_package undertilde 0
\cite_engine natbib
\cite_engine_type authoryear
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date true
\justification true
\use_refstyle 0
\use_minted 0
\index Index
\shortcut idx
\color #008000
\end_index
\leftmargin 1in
\topmargin 1in
\rightmargin 1in
\bottommargin 1in
\secnumdepth 3
\tocdepth 3
\paragraph_separation skip
\defskip medskip
\is_math_indent 0
\math_numbering_side default
\quotes_style english
\dynamic_quotes 0
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Standard
\noindent
\begin_inset ERT
status open

\begin_layout Plain Layout

%% Fill in values of the arguments here, 
\end_layout

\begin_layout Plain Layout

%% If blanks are needed, must insert value " ~ "
\end_layout

\begin_layout Plain Layout

%% If comma needed inside value, wrap in {}.
\end_layout

\begin_layout Plain Layout

%% Delete secondauthor and thirdauthor if not needed
\end_layout

\begin_layout Plain Layout


\backslash
guidesetup{%
\end_layout

\begin_layout Plain Layout

  author={
\end_layout

\begin_layout Plain Layout

    lastname=Author, 
\end_layout

\begin_layout Plain Layout

    firstname=First, 
\end_layout

\begin_layout Plain Layout

    affiliation=Title{,}~Institute,
\end_layout

\begin_layout Plain Layout

    email=first@ku.edu},
\end_layout

\begin_layout Plain Layout

  author={
\end_layout

\begin_layout Plain Layout

    lastname=Author, 
\end_layout

\begin_layout Plain Layout

    firstname=Second, 
\end_layout

\begin_layout Plain Layout

    affiliation=Title{,}~Institute, 
\end_layout

\begin_layout Plain Layout

    email=second@ku.edu}, 
\end_layout

\begin_layout Plain Layout

  author={
\end_layout

\begin_layout Plain Layout

    lastname=Author,
\end_layout

\begin_layout Plain Layout

    firstname=Third, 
\end_layout

\begin_layout Plain Layout

    affiliation=Title{,}~Institute,
\end_layout

\begin_layout Plain Layout

    email=third@ku.edu}, 
\end_layout

\begin_layout Plain Layout

  url={https://your.website.here.edu/guides},
\end_layout

\begin_layout Plain Layout

  keywords={knitr, LaTeX, reproducible documents},
\end_layout

\begin_layout Plain Layout

  title={A Title for Skeleton Template: rnw2pdf-guide-knit},
\end_layout

\begin_layout Plain Layout

  leftlogo={theme/logoleft.pdf},
\end_layout

\begin_layout Plain Layout

  rightlogo={theme/logo-vert.pdf},
\end_layout

\begin_layout Plain Layout

  number={0}
\end_layout

\begin_layout Plain Layout

}
\end_layout

\begin_layout Plain Layout


\backslash
guidehdr
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

% 1.
 If you have an address file, use it here:
\end_layout

\begin_layout Plain Layout


\backslash
input{addressFooter.tex}
\end_layout

\begin_layout Plain Layout

% 2.
 If you don't have an address file, remove % signs and fill in your information
\end_layout

\begin_layout Plain Layout

% This stanza must end with 
\begin_inset Quotes eld
\end_inset


\backslash
guideftr
\begin_inset Quotes erd
\end_inset


\end_layout

\begin_layout Plain Layout

% (after removing percent signs):
\end_layout

\begin_layout Plain Layout

%
\backslash
urlstyle{tt}
\end_layout

\begin_layout Plain Layout

%
\backslash
footersetup{
\end_layout

\begin_layout Plain Layout

%  leftside={
\end_layout

\begin_layout Plain Layout

%    lone={Address line 1}, 
\end_layout

\begin_layout Plain Layout

%    ltwo={Address line 2}, 
\end_layout

\begin_layout Plain Layout

%    lthree={City State Zipcode}},
\end_layout

\begin_layout Plain Layout

%  rightside={
\end_layout

\begin_layout Plain Layout

%    rone={Web: 
\backslash
url{https://crmda.ku.edu}},
\end_layout

\begin_layout Plain Layout

%    rtwo={Email: 
\backslash
href{mailto:you@where.edu}{
\backslash
url{you@where.edu}}},
\end_layout

\begin_layout Plain Layout

%    rthree={Phone: 123-345-5678}}
\end_layout

\begin_layout Plain Layout

%}
\end_layout

\begin_layout Plain Layout

%
\backslash
guideftr
\end_layout

\begin_layout Plain Layout

% 3.
 If you don't want an address footer, just delete this subsection.
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\begin_inset ERT
status open

\begin_layout Plain Layout

% Please leave this code
\end_layout

\begin_layout Plain Layout

<<ignoremeRsetup, echo=FALSE, include=FALSE>>=
\end_layout

\begin_layout Plain Layout

tdir <- 
\begin_inset Quotes eld
\end_inset

tmpout
\begin_inset Quotes erd
\end_inset


\end_layout

\begin_layout Plain Layout

if(!dir.exists(tdir)) dir.create(tdir, showWarnings=FALSE)
\end_layout

\begin_layout Plain Layout

library(stationery)
\end_layout

\begin_layout Plain Layout

opts.orig <- options()
\end_layout

\begin_layout Plain Layout

options(width=80, prompt=" ", continue="  ")
\end_layout

\begin_layout Plain Layout

options(useFancyQuotes = FALSE) 
\end_layout

\begin_layout Plain Layout

set.seed(12345)
\end_layout

\begin_layout Plain Layout

par.orig <- par(no.readonly=TRUE)
\end_layout

\begin_layout Plain Layout

pdf.options(onefile=FALSE,family="Times",pointsize=10)
\end_layout

\begin_layout Plain Layout

## Chunk output, knit replaces Sweave 
\end_layout

\begin_layout Plain Layout

library(knitr)
\end_layout

\begin_layout Plain Layout

opts_chunk$set(fig.path="tmpout/t-", split=TRUE, 
\end_layout

\begin_layout Plain Layout

               ae=FALSE, fig.height=4, fig.width=6, comment=NA)
\end_layout

\begin_layout Plain Layout

@
\end_layout

\begin_layout Plain Layout


\backslash
fvset{listparameters={
\backslash
setlength{
\backslash
topsep}{0em}}}
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\begin_inset ERT
status open

\begin_layout Plain Layout

% We need 2 image files for logos, top left (logoleft) and right
\end_layout

\begin_layout Plain Layout

% (logo-vert).
 
\end_layout

\begin_layout Plain Layout

% You can manually copy your desired image files
\end_layout

\begin_layout Plain Layout

% 
\begin_inset Quotes eld
\end_inset

logoleft.pdf
\begin_inset Quotes erd
\end_inset

 and 
\begin_inset Quotes eld
\end_inset

logo-vert.pdf
\begin_inset Quotes erd
\end_inset

 into the theme folder.
 
\end_layout

\begin_layout Plain Layout

% Or run this to retrieve or create them:
\end_layout

\begin_layout Plain Layout

<<texcopy, include=FALSE, echo=FALSE>>=
\end_layout

\begin_layout Plain Layout

## The logos we need are
\end_layout

\begin_layout Plain Layout

logos <- c("logoleft.pdf", "logo-vert.pdf")
\end_layout

\begin_layout Plain Layout

## This will retrieve logo files from a designated package:
\end_layout

\begin_layout Plain Layout

getFiles(logos, pkg = "stationery", overwrite = FALSE)
\end_layout

\begin_layout Plain Layout

## If you do not have a file after that, 
\end_layout

\begin_layout Plain Layout

## the following will manufacture a blank images for placeholders
\end_layout

\begin_layout Plain Layout

if(!file.exists(
\begin_inset Quotes eld
\end_inset

theme/logoleft.pdf
\begin_inset Quotes erd
\end_inset

)){
\end_layout

\begin_layout Plain Layout

  blankPDF(file = "theme/logoleft.pdf", height=1.2, width=1.2, messg = 
\begin_inset Quotes eld
\end_inset


\begin_inset Quotes erd
\end_inset

)
\end_layout

\begin_layout Plain Layout

}
\end_layout

\begin_layout Plain Layout

if(!file.exists(
\begin_inset Quotes eld
\end_inset

theme/logo-vert.pdf
\begin_inset Quotes erd
\end_inset

)){
\end_layout

\begin_layout Plain Layout

  blankPDF(file = "theme/logo-vert.pdf", height=2, width=1.5, messg = 
\begin_inset Quotes eld
\end_inset


\begin_inset Quotes erd
\end_inset

)
\end_layout

\begin_layout Plain Layout

}
\end_layout

\begin_layout Plain Layout

@
\end_layout

\end_inset


\end_layout

\begin_layout Abstract
\noindent
This is an abstract.
 Please include a terse, yet descriptive statement here of less than 200
 words.
 It should avoid colloquialisms and polysyllabic profundities.
\end_layout

\begin_layout Standard
\begin_inset CommandInset toc
LatexCommand tableofcontents

\end_inset


\end_layout

\begin_layout Section
Introduction
\end_layout

\begin_layout Standard
Do put your title & name in the top block.
 
\end_layout

\begin_layout Standard
The code chunks above this, and the one in the final section, are important.
 Don't change them unless you know what you are doing.
\end_layout

\begin_layout Standard
Don't change margins, geometry, or hyperlink options with LyX pull down
 menus or the document won't compile.
 Edit preamble for that.
\end_layout

\begin_layout Section
Check our instructions manuals
\end_layout

\begin_layout Enumerate
Brief instruction sheet in same folder as this skeleton: 
\begin_inset Quotes eld
\end_inset

instructions
\begin_inset Quotes erd
\end_inset


\end_layout

\begin_layout Enumerate
The vignettes in the crmda package
\end_layout

\begin_deeper
\begin_layout Enumerate
stationery 
\end_layout

\begin_layout Enumerate
code chunks
\end_layout

\end_deeper
\begin_layout Section
Write Sections & Subsections
\end_layout

\begin_layout Standard
Please do use sections and focused subsections to help readers find what
 they want.
\end_layout

\begin_layout Section
R Code Chunks Work
\end_layout

\begin_layout Standard
Listing objects differ in output from R
\begin_inset CommandInset citation
LatexCommand citep
key "RCore"
literal "true"

\end_inset

 code chunks.
 Here is listing output.
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "style=Rinput"
inline false
status open

\begin_layout Plain Layout

$ ./rnw2pdf --engine='"knitr"' skeleton.lyx
\end_layout

\end_inset


\end_layout

\begin_layout Standard
When using knitr, we have not succeeded in customizing the display of input
 or output cells.
 What you see is what they insist on, at least until we figure how to change
 it.
\end_layout

\begin_layout Standard
\begin_inset ERT
status open

\begin_layout Plain Layout

<<norm10>>=
\end_layout

\begin_layout Plain Layout

set.seed(1234)
\end_layout

\begin_layout Plain Layout

x <- rnorm(100)
\end_layout

\begin_layout Plain Layout

head(x)
\end_layout

\begin_layout Plain Layout

mean(x)
\end_layout

\begin_layout Plain Layout

@
\end_layout

\end_inset


\end_layout

\begin_layout Standard
That's the knitr output.
\end_layout

\begin_layout Standard
I wish instead the input and output would display in separately decorated
 areas with the style I prefer, 
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "style=Rinput"
inline false
status open

\begin_layout Plain Layout

set.seed(1234)
\end_layout

\begin_layout Plain Layout

x <- rnorm(100)
\end_layout

\begin_layout Plain Layout

head(x)
\end_layout

\begin_layout Plain Layout

mean(x)
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "style=Routput"
inline false
status open

\begin_layout Plain Layout

mean(x)
\end_layout

\begin_layout Plain Layout

[1] -0.1567617
\end_layout

\end_inset


\end_layout

\begin_layout Standard
but knitr makes this difficult at the moment.
\end_layout

\begin_layout Section
Session Info
\begin_inset CommandInset label
LatexCommand label
name "sec:Session-Info"

\end_inset


\end_layout

\begin_layout Standard
Please leave this section for guide documents.
 It is important for replication.
 
\end_layout

\begin_layout Standard
\begin_inset ERT
status open

\begin_layout Plain Layout

<<session, echo=F>>=
\end_layout

\begin_layout Plain Layout

sessionInfo()
\end_layout

\begin_layout Plain Layout

if(!is.null(warnings())){
\end_layout

\begin_layout Plain Layout

    print("Warnings:")
\end_layout

\begin_layout Plain Layout

    warnings()}
\end_layout

\begin_layout Plain Layout

@
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\begin_inset ERT
status open

\begin_layout Plain Layout

<<opts20, include=F>>=
\end_layout

\begin_layout Plain Layout

## Don't delete this.
 It puts the interactive session options
\end_layout

\begin_layout Plain Layout

## back the way they were.
 If this is compiled within a session
\end_layout

\begin_layout Plain Layout

## it is vital to do this.
\end_layout

\begin_layout Plain Layout

options(opts.orig)
\end_layout

\begin_layout Plain Layout

par(par.orig)
\end_layout

\begin_layout Plain Layout

@
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\begin_inset CommandInset bibtex
LatexCommand bibtex
btprint "btPrintCited"
bibfiles "R"
options "apacitex"

\end_inset


\end_layout

\end_body
\end_document
