A collection of body diagram visualizations in R
An R package that provides raw x,y coordinates to draw human body diagrams in R. This type of visualizations are commonly used in Sport Science, Strength and Conditioning and other health related areas to report visual information about muscle / joint related metrics such as muscle soreness, muscle activation, strength, temperature, etc...
For more information on how body diagrams can be used in R please visit this article and this github repo where I wrote about some ideas to add visualizations to reports and integrate with other packages for more functionality.
#Install from CRAN
#Not currently on CRAN
#Install the development version from GitHub
install.packages("devtools")
devtools::install_github("josedv82/bdgramR")
{bdgramR} is a small package and provides only a handful on functions:
library(bdgramR)
model_types(data = data)
# A tibble: 9 x 1
Model
<fct>
1 futuristic_male
2 original_male
3 original_female
4 thermohuman_male
5 thermohuman_female
6 athletesr
7 basic_female
8 basic_male
9 multi_view_male
library(bdgramR)
glimpse_models(data = data, color = "brown", fill = "orange")
library(bdgramR)
dat <- bdgramr(data = data, model = "original_male")
head(dat)
Id View Part Group Muscle Side x y
1 1 Posterior Lower_Body Calves Soleus Right 739 723
2 1 Anterior Lower_Body Calves Soleus Right 739 724
3 1 Anterior Lower_Body Calves Soleus Right 740 724
4 1 Anterior Lower_Body Calves Soleus Right 740 725
5 1 Anterior Lower_Body Calves Soleus Right 741 725
6 1 Anterior Lower_Body Calves Soleus Right 741 726
library(bdgramR)
library(ggplot2)
dat <- bdgramr(data = data, model = "original_male")
ggplot(data = dat, aes(x,y, group = Id)) +
geom_bdgramr()
Like with any other ggplot, users can add more layers to further customise the visualization. For example:
library(bdgramR)
library(ggplot2)
dat <- bdgramr(data = data, model = "original_male")
plot <- ggplot(data = dat, aes(x,y, group = Id)) +
geom_bdgramr(color = "cyan", aes(fill = Muscle)) +
ggtitle("BdygramR: original_male diagram")
plot
I'd like to credit two known sources of inspiration for some of the body diagrams in this package.
Two of the available body diagrams are inspired on athleteSR and Thermohuman as the body diagrams they use on their software are very well designed. In this case, I have named them after the actual software.
{bdgramR} is a small package and likely not much more development needed besides adding some more body diagram types. However, the package is currently under development and I welcome any feedback to improve or issues you may come across when using it.