Skip to content

Commit 688a7e7

Browse files
committed
Edited up the Sweave document
1 parent 065914b commit 688a7e7

File tree

3 files changed

+41
-37
lines changed

3 files changed

+41
-37
lines changed

SF_2011/Benetech/R/benetech_report.rnw

+40-31
Original file line numberDiff line numberDiff line change
@@ -67,34 +67,6 @@ source('load_data.R')
6767
\titlepage
6868
\end{frame}
6969

70-
\begin{frame}[plain]
71-
\frametitle{Average account longevity}
72-
\begin{block}{Question}
73-
How does (date.last.saved - date.authorized) vary as a function of date.authorized?
74-
\end{block}
75-
Some notes about the dataset:
76-
\begin{itemize}
77-
\item Many authorized dates are NA:
78-
<<<echo=T, eval=T>>=
79-
xtable(is.na(wdf$authorized_date))
80-
@
81-
\item Some last saved at dates are before the authorized dates:
82-
\item $\Sexpr{round(3/2)}$
83-
\end{itemize}
84-
\end{frame}
85-
86-
<<<<<<< HEAD
87-
=======
88-
\begin{frame}
89-
\frametitle{Global Martus Use}
90-
<<echo=false, include=false>>=
91-
source('11_map_report.R')
92-
@
93-
\includegraphics[width=11cm]{benetech_report-map_plot.pdf} \\
94-
As of \today
95-
\end{frame}
96-
97-
>>>>>>> 9d4412c0ae24a168e106f195a1ab47127b8ffb94
9870
\begin{frame}{Database Usage Statistics}
9971

10072
\begin{table}[ht]
@@ -123,7 +95,7 @@ source( "Q1_server_usage.R" )
12395
\begin{figure}
12496
\begin{center}
12597

126-
<<TotalUsagePlot, fig=TRUE, echo=FALSE, width=2.5, height=2.5>>=
98+
<<TotalUsagePlot, fig=TRUE, echo=FALSE, width=4, height=3>>=
12799
source( "Q1b_server_growth.R" )
128100
plot.tot(bfs.big)
129101
@
@@ -139,7 +111,7 @@ plot.tot(bfs.big)
139111
\begin{figure}
140112
\begin{center}
141113

142-
<<AverageDailyUsagePlot, fig=TRUE, echo=FALSE, width=4, height=2.5>>=
114+
<<AverageDailyUsagePlot, fig=TRUE, echo=FALSE, width=4, height=3>>=
143115
plot.deriv(bfs.little)
144116
@
145117
\caption{Daily usage over time}
@@ -154,7 +126,7 @@ plot.deriv(bfs.little)
154126
\begin{figure}
155127
\begin{center}
156128

157-
<<AverageDailyUsagePlotTruncated, fig=TRUE, echo=FALSE, width=2.5, height=2.5>>=
129+
<<AverageDailyUsagePlotTruncated, fig=TRUE, echo=FALSE, width=4, height=3>>=
158130
plot.deriv.trunc(bfs.little)
159131
@
160132
\caption{Average Daily Usage (Truncated)}
@@ -170,7 +142,44 @@ Note: as previous slide, but truncated to 95\% of values to see typical behavior
170142
<<CustomFieldStats, results=tex, echo=FALSE>>=
171143
source( "Q4_custom_field_code.R" )
172144
@
145+
\end{frame}
173146

147+
<<echo=false>>=
148+
source('q5.R')
149+
@
150+
151+
\begin{frame}[plain]
152+
\frametitle{Average account longevity}
153+
\begin{block}{Question}
154+
How does (date.last.saved - date.authorized) vary as a function of date.authorized?
155+
\end{block}
156+
Some notes about the dataset:
157+
\begin{itemize}
158+
\item Many authorized dates are NA:
159+
<<TimeBoxPlots, fig=TRUE, echo=FALSE, width=4, height=3>>=
160+
print(ggplot(data=working_set, aes(x=time_group_halves, y=time_diff_int/60/60/24)) +
161+
geom_point() + geom_boxplot() + opts(axis.text.x=theme_text(angle=-90)))
162+
@
163+
\item Some last saved at dates are before the authorized dates:
164+
\item $\Sexpr{round(3/2)}$
165+
\end{itemize}
166+
\end{frame}
167+
168+
\begin{frame}
169+
\frametitle{By Account Quarter, Scatter}
170+
<<ActivityByAccountScatter, fig=TRUE, echo=FALSE, width=4, height=3>>=
171+
print(ggplot(data=by_account_quarter, aes(x=count, y=time_diff_median_seconds/60/60)) +
172+
geom_point() + coord_trans(x="log10") + opts(axis.text.x=theme_text(angle=-90)))
173+
@
174+
\end{frame}
175+
176+
\begin{frame}
177+
\frametitle{By Account Quarter, Box}
178+
<<ActivityByAccountBox, fig=TRUE, echo=FALSE, width=4, height=3>>=
179+
print(ggplot(data=by_account_quarter, aes(x=count, y=time_diff_mean_seconds/60/60)) +
180+
geom_point() + geom_boxplot(aes(group=round_any(log10(count), 1))) +
181+
opts(axis.text.x=theme_text(angle=-90)))
182+
@
174183
\end{frame}
175184

176185
\begin{frame}

SF_2011/Benetech/R/load_data.R

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
# Load libraries
1414
library(ggplot2)
15+
library(xtable)
1516

1617
# Load data
1718
data.file <- '../data/martus-bullacct-4datadive-2011-11-03.csv'

SF_2011/Benetech/R/q5.R

-6
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,6 @@ colnames(by_account) <- c("public_code", "count")
8080
by_account_quarter <- ddply(working_set, .(public_code, time_group_quarters), summary_function, "time_diff_int")
8181
by_account_quarter <- join(by_account, by_account_quarter)
8282

83-
ggplot(data=by_account_quarter, aes(x=count, y=time_diff_median_seconds/60/60)) +
84-
geom_point() + coord_trans(x="log10") + opts(axis.text.x=theme_text(angle=-90))
85-
86-
ggplot(data=by_account_quarter, aes(x=count, y=time_diff_mean_seconds/60/60)) +
87-
geom_point() + geom_boxplot(aes(group=round_any(log10(count), 1))) +
88-
opts(axis.text.x=theme_text(angle=-90))
8983

9084
# huge range for accounts who use this once, pretty stead for people who use this more
9185

0 commit comments

Comments
 (0)