generated from datasciencecampus/skeletor-public
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathgov-uk-rap-materials_mapping-skills-progress.Rmd
195 lines (159 loc) · 5.4 KB
/
gov-uk-rap-materials_mapping-skills-progress.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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
---
title: "Documenting skills development"
author: "Joseph Crispell & Laurie Baker"
date: "`r format(Sys.Date(), '%d %b %Y')`"
output:
html_document:
number_sections: yes
toc: yes
toc_depth: '2'
toc_float: yes
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r preparation, include=FALSE}
# Load libraries
library(fmsb)
```
# Introduction
Here is a quick tutorial about mapping our skills progression using R. We're going to be using the [fmsb]() to visualise our skills progress, which we'll install and load with the following code:
```{r install and load, eval=FALSE}
install.packages("fmsb")
library(fmsb)
```
# Our skill areas
We'll look to categorise our skills progress into the following themes:
- **Programming**
- **Statistics**
- **Databases**
- **Projects**
- **Web development**
- **Versioning**
We can then create a `data.frame` that records our current skills point:
```{r define skills table}
# Set you current skills point
skillsPointsCurrent <- data.frame(
"Programming" = c(5, 1, 4),
"Statistics" = c(5, 1, 3),
"Databases" = c(5, 1, 2),
"Projects" = c(5, 1, 3),
"Web" = c(5, 1, 3),
"Versioning" = c(5, 1, 3)
)
rownames(skillsPointsCurrent) <- c("Max level", "Min level", "My level")
skillsPointsCurrent
```
# Visualising our skills point
```{r}
radarchart(skillsPointsCurrent,
axistype = 1, # Centre axis labels
title = "Starting Point",
pcol = rgb(0.2, 0.5, 0.5, 0.6), # Colour of polygon points
pfcol = rgb(0.2, 0.5, 0.5, 0.5), # COlour of polygon fill
plwd = 2, # Line width for the polygon
cglcol = "grey", # COlour of lines in web
cglty = 1, # Type of line in radar
axislabcol = "blue", # Skills categories colour
caxislabels = c("Unaware", "Aware", "Working", "Practitioner", "Expert"), # Skills categories
cglwd = 0.3, # Width of line for radar
calcex = 0.75, # Font size for axis labels
vlcex = 1
) # Font size for skills labels
```
# Thinking about progression
Next, I'd like to consider where I would like to get to with my learning:
```{r where Id like to be}
# Set you goal skills point
skillsPointsGoal <- data.frame(
"Programming" = c(5, 1, 4),
"Statistics" = c(5, 1, 4),
"Databases" = c(5, 1, 3),
"Projects" = c(5, 1, 4),
"Web" = c(5, 1, 3),
"Versioning" = c(5, 1, 5)
)
rownames(skillsPointsGoal) <- c("Max level", "Min level", "My level")
# Plot my goal point
radarchart(skillsPointsGoal,
axistype = 1, # Centre axis labels
title = "Where I'd like to be",
pcol = rgb(0.2, 0.5, 0.5, 0.6), # Colour of polygon
pfcol = rgb(0.2, 0.5, 0.5, 0.5), # COlour of polygon fill
plwd = 2, # Line width for the polygon
cglcol = "grey", # COlour of lines in web
cglty = 1, # Type of line in radar
axislabcol = "blue", # Skills categories colour
caxislabels = c("Unaware", "Aware", "Working", "Practitioner", "Expert"), # Skills categories
cglwd = 0.3, # Width of line for radar
calcex = 0.75, # Font size for axis labels
vlcex = 1
) # Font size for skills labels
```
# Overlaying skills points in a single plot
We can use the [basicPlotteR](https://github.com/JosephCrispell/basicPlotteR/blob/master/README.md#radarchart) R package (shameless self-promotion!) to overlay our skills points in a single plot. Install it with the following code:
```{r install basicPlotteR, eval=FALSE}
install.packages("devtools")
devtools::install_github("JosephCrispell/basicPlotteR")
library(basicPlotteR)
```
```{r load basicPlotteR, echo=FALSE}
library(basicPlotteR)
```
Then create the radar chart with the following code:
```{r radar chart with basicPlotteR}
# Create a chart with my current skills points
radarChart(
scores = skillsPointsCurrent["My level", ],
names = colnames(skillsPointsCurrent),
levels = c("Unaware", "Aware", "Working", "Practitioner", "Expert")
)
# Add my goal onto the same chart
radarChart(
scores = skillsPointsGoal["My level", ],
names = colnames(skillsPointsGoal),
levels = c("Unaware", "Aware", "Working", "Practitioner", "Expert"), add = TRUE,
polygon.col = "blue"
)
# Add a legend
legend("topright", legend = c("Current", "Goal"), text.col = c("red", "blue"), bty = "n", xpd = TRUE)
```
# Creating an interactive skills map
Lastly, we can use the [plotly](https://plotly.com/r/radar-chart/) R package to create an interactive radar chart. Install plotly with the following code:
```{r install plotly, eval=FALSE}
install.packages("plotly")
library(plotly)
```
```{r load plotly, include=FALSE}
library(plotly)
```
Then create your interactive chart like this:
```{r radar chart with plotly, warning=FALSE}
# Create a radial plot object
fig <- plot_ly(type = "scatterpolar", fill = "toself", mode = "markers")
# Add the first skills point trace - current
fig <- add_trace(fig,
r = as.numeric(skillsPointsCurrent["My level", ]),
theta = colnames(skillsPointsCurrent),
name = "Current"
)
# Add the second skills point trace - my goals
fig <- add_trace(fig,
r = as.numeric(skillsPointsGoal["My level", ]),
theta = colnames(skillsPointsGoal),
name = "Goal"
)
# Add a radial axis
fig <- layout(fig,
polar = list(
radialaxis = list(
visible = TRUE,
range = c(1, 5),
tickvals = 1:5,
ticktext = c("Unaware", "Aware", "Working", "Practitioner", "Expert")
)
)
)
# Plot the radial chart
fig
```