-
Notifications
You must be signed in to change notification settings - Fork 1
/
weightlifting.Rmd
163 lines (136 loc) · 6.89 KB
/
weightlifting.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
---
title: "weightlifting"
output:
html_document:
fig_height: 4
fig_width: 4
highlight: kate
keep_md: yes
number_sections: yes
theme: flatly
toc: yes
---
```{r setup, include=FALSE, cache=FALSE}
library(knitr)
# set global chunk options
opts_chunk$set(fig.path='figure/minimal-', fig.align='center', fig.show='hold', fig.width=8, fig.height=8, tidy=FALSE, cache=FALSE)
# options(replace.assign=TRUE,width=90)
```
# Weightlifting Is Fun
I wrote [this](http://aarongonzales.net/2014/08/blackboxfitness/) a while ago and thought i'd post this data i've been keeping for a while. Using a combination of [Fitocracy](http://www.fitocracy.com/profile/aaron_gonzales/) and manual tracking, I've managed to log nearly every rep of every training session i've had for the last several years.
## methods
### Getting Data
Getting the data from Fitocracy was the only real chore. At the time of my acquisition (Feb. 2014), their API didn't allow direct export of the data to any reasonable format, so I downloaded each individual relevant file from the Performance tab in my profile page. Some regular expressions reshaped the data a bit from this:
* "Activity","Date (YYYYMMDD)","Set",,"unit",,"unit","Combined","Points"
* "Clean and Jerk",2012-08-23,3301,125,,3,,"125 lb || 3 reps","80"
to this:
* date, exercise, weight, units, reps, quarters, bodyweight, liftratio, totalweightperset
* 2012-08-23, clean and jerk, 125, lb, 3, 2012-07-01, 165.3, 0.7562008, 375
as i didn't need the "Points" category and the activity names were cleaned a bit.
Otherwise, R was used for this post.
### Libraries used for this post:
```{r libraries}
library(lubridate)
library(ggplot2)
library(plyr)
```
### Reading and chopping up the data in R.
Lubridate is awesome.
```{r}
lifting <- read.csv("/dropbox/stats/weightlifting/liftinglog.csv", header=TRUE)
# lifting <- read.csv("/analysis/googledrive/liftinglog.csv", header=TRUE)
# lifting$date <- ymd(lifting$date)
lifting$date <- mdy(lifting$date)
lifting$exercise <- as.character(lifting$exercise)
lifting$exercise <- gsub("barbell ", "", lifting$exercise)
lifting$exercise <- as.factor(lifting$exercise)
# lifting <- lifting[,-7]
kg <- subset(lifting, subset = units=="kg")
lb <- subset(lifting, subset = units=="lb")
kg$weight <- kg$weight * 2.20462
kg$units <- "lb"
lifting <- rbind(lb,kg)
lifting <- subset(lifting, subset=exercise != "power snatch")
lifting <- subset(lifting, subset=exercise != "power clean")
# lifting <- subset(lifting, subset=exercise != "front squat")
lifting <- droplevels(lifting)
```
I dropped the power version of the snatch and clean due to inconsistent logging on my part.
Adding date ranges by quarters for group the lifts by a three-month period.
```{r}
lifting$quarters <- cut(lifting$date, breaks="quarter")
labs <- paste(substr(levels(lifting$quarters),1,4),"/",1:4, sep="")
lifting$quarters <- factor(lifting$quarters)
```
Adding in my bodyweight and a ratio of lift:bodyweight. The bodyweight is accurate roughly to 1.5 lb.
```{r}
lifting <- ddply( lifting, .(quarters), transform, bodyweight=161 + (4.3*as.numeric(quarters)))
lifting$liftratio <- lifting$weight / lifting$bodyweight
range(lifting$bodyweight)
range(lifting$liftratio)
```
I also added in weight moved per set, mostly because it's kind-of cool
```{r}
lifting <- ddply( lifting, .(quarters), transform, totalweightperset= weight*reps)
```
## "Results" - or something like that.
### Pretty pretty plots
The following plot shows boxplots the ratio of lift:bodyweight number. Clearly, the deadlift and squat have the higher ratios here, as this make plenty of biomechanical sense. I don't train the trational deadlift very often anymore and i think that's why it's so skewed.
```{r generalPl}
p <- ggplot(lifting, aes(exercise, liftratio))
p <- p + geom_boxplot()
print(p)
# p + geom_violin()
```
This next two plots are similar. Both show a similar thing - boxplots of
weight moved or liftratio broken up by yearly quarter to show how they
have changed over time. The red diamond denotes the highest value for the
quarter and it's interesting to see some are considered outliers for that time period.
The black line connects the mean value over time (the line in the boxes denotes the median).
As I started maxing out my lifts more regularly over the last 9 months and stopped
doing sets that had high volume (no more Crossfit for me) I have had more accurate numbers, perhpas.
```{r timeplots, fig.cap="Major lifts progression over time, by quarter. red diamond is the best lift for the quarter, black line is median weight lifted for the quarter. This includes warm up weights.",fig.width=8, fig.height=8,fig.show='hold' }
p <- ggplot(lifting, aes(quarters, weight))
p <- p + geom_boxplot()
p <- p + stat_summary(aes(group=exercise), fun.y=median, geom="line", size=1.5)
p <- p + stat_summary(aes(group=exercise), fun.y=max, geom="point", size=2, shape=23, fill="red")
p <- p + facet_wrap(~ exercise)
p <- p + labs(
# title omitted; letting rmarkdown handle it
# title="Major lifts progression over time, by quarter
# red diamond is the best lift for the quarter, black line is median
# weight lifted for the quarter. This includes
# warm up weights.",
y = "Weight (Lb)",
x="yearly quarter")
p <- p + theme(text = element_text(size=12),
axis.text.x = element_text(angle=90, vjust=1, size=10),
axis.text.y = element_text(size=10))
print(p)
p_2 <- ggplot(lifting, aes(quarters, liftratio))
p_2 <- p_2 + geom_boxplot()
# p_2 <- p_2 + stat_summary(aes(group=exercise), fun.y=median, geom="line", size=2)
p_2 <- p_2 + stat_summary(aes(group=exercise), fun.y=mean, geom="line", size=1.5)
p_2 <- p_2 + stat_summary(aes(group=exercise), fun.y=max, geom="point", size=2, shape=23, fill="red")
p_2 <- p_2 + facet_wrap(~ exercise)
p_2 <- p_2 + labs(
# title="Major lifts progression over time, by quarter
# red diamond is the best lift for the quarter, black line is median
# weight lifted for the quarter. This includes
# warm up weights.",
y = "Ratio of amount lifted to bodyweight",
x="yearly quarter")
p_2 <- p_2 + theme(text = element_text(size=12),
axis.text.x = element_text(angle=90, vjust=1, size=10),
axis.text.y = element_text(size=10))
print(p_2)
# library(gridExtra)
# grid.arrange(p, p_2, ncol=2, main="Weightlifting Progression by quarters")
```
I like seeing that overall, it's clear that i'm getting stronger, both in pounds moved and in the ratio of pounds moved to bodyweight (though not so great in the overhead or olympic lifts as much, but i suppose that's expected. ) I should probably train my front squat a bit more and perhaps track other lifts, like overhead squats or snatch assistance movements.
### I've lifted almost two million pounds in two years
...Which is a cool thing.
```{r}
sum(lifting$totalweightperset)
```
Weightlifting is fun.