diff options
Diffstat (limited to 'climbing.rnw')
-rw-r--r-- | climbing.rnw | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/climbing.rnw b/climbing.rnw index 9d7da1c..1e4a205 100644 --- a/climbing.rnw +++ b/climbing.rnw @@ -23,8 +23,6 @@ library(ggplot2) library(ggforce) library(scales) @ - - <<CSV>>= attendance <- data.frame( read.csv("./debarque.csv", @@ -44,40 +42,38 @@ attendance$WEEKDAY <- factor(attendance$WEEKDAY, "Saturday")) @ -<<PLOTTING>>= +<<WEEK-PLOT>>= # Day of the week averages week <- ggplot(attendance, aes(x=TIME, y=CLIMBERS, group=WEEKDAY, col=as.factor(DAY))) + - geom_path() + + geom_path(group=attendance$DAY) + geom_smooth(method="gam") + scale_y_continuous( - breaks=seq(0,25,1), + breaks=seq(1,25,2), limits=c(0,25), labels = scales::number_format(accuracy = 1)) + scale_x_datetime( labels=date_format("%R", tz="America/Toronto"), - date_breaks="3 hour") + + date_breaks="2 hours") + labs(x="Heure de la journée", y="Nombre de grimpeurs") + theme(legend.position="none") + facet_wrap(~WEEKDAY) - +@ +<<TIMELINE-PLOT>>= # Daily attendances through time timeline <- ggplot(attendance, aes(x=DAY, y=CLIMBERS)) + geom_line(stat="summary", fun=mean) @ \centering -<<PRINT, echo=FALSE, fig.fullwidth=TRUE, fig.width=10>>= +<<PRINT-WEEK, echo=FALSE, fig.fullwidth=TRUE, fig.width=10>>= print(week) @ -<<TIMELINE, fig.width=10, fig.fullwidth=TRUE, echo=FALSE>>= +<<PRINT-TIMELINE, fig.width=10, fig.fullwidth=TRUE, echo=FALSE>>= print(timeline) @ - - - \end{document} |