Skip to content

Commit

Permalink
Commence project
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeromy Anglim committed Nov 27, 2010
0 parents commit db17d66
Show file tree
Hide file tree
Showing 12 changed files with 460 additions and 0 deletions.
Empty file added .gitignore
Empty file.
Empty file added .output/Report_Template.tex
Empty file.
18 changes: 18 additions & 0 deletions .project
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Sweave_Personality_Reports</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>de.walware.statet.r.builders.RSupport</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>de.walware.statet.base.StatetNature</nature>
<nature>de.walware.statet.r.RNature</nature>
</natures>
</projectDescription>
Empty file added README.md
Empty file.
139 changes: 139 additions & 0 deletions Report_Template.Rnw
@@ -0,0 +1,139 @@
%
<<import data>>=
source("main.R")

# usally the i value will be specified by the makefile
# but if it is not, make i = 1
if(!any(ls() %in% "i")) i <- 1

id <- ipip$id[i] # specify the active ID
@
\documentclass[a4paper]{article}
\usepackage[OT1]{fontenc}
\usepackage{Sweave}
\usepackage{chngpage} % allows use of adjust width
\SweaveOpts{echo=FALSE}
\setkeys{Gin}{width=0.8\textwidth}
\usepackage{hyperref} % for links (only use on final printed version
\usepackage{booktabs}
\usepackage[left=40mm, right=40mm, top=30mm, bottom=30mm, includefoot, headheight=13.6pt]{geometry} %set margins to be 30mm (needs to include page numbers
\hypersetup{pdfpagelayout=SinglePage} % http://www.tug.org/applications/hyperref/ftp/doc/manual.html
\hypersetup{
colorlinks,%
citecolor=black,%
filecolor=black,%
linkcolor=black,%
urlcolor=black
} % have links but print liek standard text http://en.wikibooks.org/wiki/LaTeX/Hyperlinks
\begin{document}
\title{Sweave Example: Example Personality Test Report;
ID = \Sexpr{id}}
\author{Author: Jeromy Anglim}
\maketitle
<<plot_scale_distributions, fig=true>>=
#plotScale <- function(ipipscale) {
# ggplot(ipip, aes_string(x=ipipscale["scale"])) +
# scale_x_continuous(limits=c(1, 5),
# name = ipipscale["name"]) +
# scale_y_continuous(name = "", labels ="", breaks = 0) +
# geom_density(fill="green", alpha = .5) +
# geom_vline(xintercept = ipip[ipip$id %in% id, ipipscale["scale"]],
# size=1)
#
#}
#
#scaleplots <- apply(ipipscales, 1, function(X) plotScale(X))
#
#arrange(scaleplots[[1]],
# scaleplots[[2]],
# scaleplots[[3]],
# scaleplots[[4]],
# scaleplots[[5]],
# ncol=3)
@
Figure of distribution of scores on each scale.
Black vertical line indicates your score.
<<prepare_table>>=
ipiptable <- list()
ipiptable$colnames <- c("item", "scaleF", "text", "meanF",
"sdF", "is1F", "is2F", "is3F", "is4F", "is5F")
ipiptable$cells <- ipipsummary[,ipiptable$colnames ]
ipiptable$cells$item <- paste(ipiptable$cells$item, ".", sep="")
# assign actual respones to table
ipiptable$cells$response <-
c("VI", "MI", "N", "MA", "VA")[as.numeric(ipip[ipip$id %in% id, ipipmeta$variable])]
ipiptable$cellsF <- as.matrix(ipiptable$cells)
ipiptable$cellsF <- ipiptable$cellsF[order(ipiptable$cellsF[, "scaleF"]), ]
ipiptable$row1 <- c("", "Scale", "Item Text",
"M", "SD", "VI\\%", "MI\\%", "N\\%", "MA\\%", "VA\\%", "Response")
ipiptable$table <- rbind(ipiptable$row1, ipiptable$cellsF)
ipiptable$tex <- paste(
apply(ipiptable$table, 1, function(X) paste(X, collapse = " & ")),
"\\\\")
for(i in c(41, 31, 21, 11, 1)) {
ipiptable$tex <- append(ipiptable$tex, "\\midrule", after=i)
}
ipiptable$tex1 <- ipiptable$tex[c(1:34)]
ipiptable$tex2 <- ipiptable$tex[c(1,35:56)]
@
\begin{table}
\begin{adjustwidth}{-1cm}{-1cm}
Table of results for (A)greeableness, (C)onscientiousness
and (E)motional (S)tability items.
Response options were
1 = (V)ery (I)naccurate,
2 = (M)oderately (I)naccurate,
3 = (N)either Inaccurate nor Accurate,
4 = (M)oderately (A)ccurate
5 = (V)ery (A)ccurate.
Thus, VI\% indicates the percentage of the norm sample
giving a response indicating that the item is a Very Inaccurate
description of themselves.
Response indicates your response to the questionnaire.
\begin{center}
\begin{tabular}{rrp{4cm}rrrrrrrr}
\toprule
<<table_part1, results=tex>>=
cat(ipiptable$tex1, sep="\n")
@
\bottomrule
\end{tabular}
\end{center}
\end{adjustwidth}
\end{table}
\begin{table}
\begin{adjustwidth}{-1cm}{-1cm}
\begin{center}
\begin{tabular}{rrp{4cm}rrrrrrrr}
\toprule
<<table_part1, results=tex>>=
cat(ipiptable$tex2, sep="\n")
@
\bottomrule
\end{tabular}
\end{center}
\end{adjustwidth}
\end{table}
\end{document}
33 changes: 33 additions & 0 deletions Sweave.sty
@@ -0,0 +1,33 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{Sweave}{}

\RequirePackage{ifthen}
\newboolean{Sweave@gin}
\setboolean{Sweave@gin}{true}
\newboolean{Sweave@ae}
\setboolean{Sweave@ae}{true}

\DeclareOption{nogin}{\setboolean{Sweave@gin}{false}}
\DeclareOption{noae}{\setboolean{Sweave@ae}{false}}
\ProcessOptions

\RequirePackage{graphicx,fancyvrb}
\IfFileExists{upquote.sty}{\RequirePackage{upquote}}{}

\ifthenelse{\boolean{Sweave@gin}}{\setkeys{Gin}{width=0.8\textwidth}}{}%
\ifthenelse{\boolean{Sweave@ae}}{%
\RequirePackage[T1]{fontenc}
\RequirePackage{ae}
}{}%

\DefineVerbatimEnvironment{Sinput}{Verbatim}{fontshape=sl}
\DefineVerbatimEnvironment{Soutput}{Verbatim}{}
\DefineVerbatimEnvironment{Scode}{Verbatim}{fontshape=sl}

\newenvironment{Schunk}{}{}

\newcommand{\Sconcordance}[1]{%
\ifx\pdfoutput\undefined%
\csname newcount\endcsname\pdfoutput\fi%
\ifcase\pdfoutput\special{#1}%
\else\immediate\pdfobj{#1}\fi}
118 changes: 118 additions & 0 deletions data/ipip.tsv
@@ -0,0 +1,118 @@
"id" "ipip1" "ipip2" "ipip3" "ipip4" "ipip5" "ipip6" "ipip7" "ipip8" "ipip9" "ipip10" "ipip11" "ipip12" "ipip13" "ipip14" "ipip15" "ipip16" "ipip17" "ipip18" "ipip19" "ipip20" "ipip21" "ipip22" "ipip23" "ipip24" "ipip25" "ipip26" "ipip27" "ipip28" "ipip29" "ipip30" "ipip31" "ipip32" "ipip33" "ipip34" "ipip35" "ipip36" "ipip37" "ipip38" "ipip39" "ipip40" "ipip41" "ipip42" "ipip43" "ipip44" "ipip45" "ipip46" "ipip47" "ipip48" "ipip49" "ipip50"
1 5 2 5 4 2 1 5 2 3 4 5 3 3 4 5 1 5 3 4 4 5 1 4 5 2 1 5 2 3 1 5 1 3 4 2 1 4 2 4 1 5 5 5 4 5 1 5 3 1 4
2 5 4 4 4 5 1 5 5 4 2 5 4 1 2 5 1 4 2 1 1 5 1 1 4 5 1 5 4 4 1 4 2 2 5 5 1 4 2 5 4 5 5 2 4 4 4 4 2 5 5
4 3 1 4 4 4 3 4 3 3 1 4 1 4 4 5 3 4 3 2 2 4 2 3 3 4 2 4 3 4 1 2 2 3 3 4 3 4 2 3 3 3 4 3 3 4 4 3 3 3 4
6 2 1 4 4 4 3 5 4 4 2 4 2 4 3 4 2 4 2 2 2 5 2 3 2 4 2 4 2 4 2 4 2 4 4 4 3 4 2 4 4 4 4 4 2 4 3 4 4 3 3
7 2 2 2 2 4 4 3 4 4 1 3 2 4 2 3 3 3 3 3 2 2 3 2 5 3 3 3 3 3 3 4 2 2 3 3 3 4 3 4 4 2 3 2 3 4 5 3 4 2 3
10 1 1 4 3 4 5 4 1 3 2 2 1 5 3 3 5 4 2 3 2 1 1 4 3 4 4 4 2 2 3 1 2 4 2 3 5 2 2 1 3 1 4 4 2 5 5 3 4 2 3
12 3 1 4 1 4 4 4 1 4 1 4 1 5 4 4 3 4 1 3 2 4 1 5 1 5 1 5 1 2 1 2 2 5 1 5 5 5 1 1 4 2 5 5 1 4 4 4 5 2 5
13 3 1 2 5 4 3 4 4 4 4 5 4 2 4 5 3 4 3 3 3 3 2 2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-same.html


vp.layout <- function(x, y) viewport(layout.pos.row=x, layout.pos.col=y)
arrange <- function(..., nrow=NULL, ncol=NULL, as.table=FALSE) {
dots <- list(...)
n <- length(dots)
if(is.null(nrow) & is.null(ncol)) { nrow = floor(n/2) ; ncol = ceiling(n/nrow)}
if(is.null(nrow)) { nrow = ceiling(n/ncol)}
if(is.null(ncol)) { ncol = ceiling(n/nrow)}
## NOTE see n2mfrow in grDevices for possible alternative
grid.newpage()
pushViewport(viewport(layout=grid.layout(nrow,ncol) ) )
ii.p <- 1
for(ii.row in seq(1, nrow)){
ii.table.row <- ii.row
if(as.table) {ii.table.row <- nrow - ii.table.row + 1}
for(ii.col in seq(1, ncol)){
ii.table <- ii.p
if(ii.p > n) break
print(dots[[ii.table]], vp=vp.layout(ii.table.row, ii.col))
ii.p <- ii.p + 1
}
}
}

0 comments on commit db17d66

Please sign in to comment.