Reputation: 651
I am trying to make an 'infographic' resume and I would like to use R. I have created a gant chart and now want to rank my skills. I can't figure out what type of chart with produce circles that are filled according to a numerical ranking. Here is an example of what I want. And below that is example data. Any help appreciated Thanks
dput(datAnal_skills)
structure(list(Type = c("Programming", "Programming", "Programming",
"Programming", "Analytics", "Analytics", "Analytics", "Analytics",
"Personal", "Personal", "Personal", "Personal"), Skill = c("R",
"Perl", "Python", "SQL", "Visualization", "Statistics", "Databases",
"Research Design", "Problem-solver", "Motivated", "Team player",
"Multi-tasker"), Of.5 = c(4.7, 4.5, 4, 4, 4.7, 4.5, 4.5, 4.5,
4.5, 4.5, 4.5, 4.5), Of.10 = c(9L, 8L, 8L, 8L, 9L, 9L, 8L, 8L,
9L, 9L, 8L, 8L)), class = "data.frame", row.names = c(NA, -12L
))
Upvotes: 1
Views: 185
Reputation: 145985
Here's an attempt cleaning up theme options.
df = df%>%
mutate(
score = round(Of.5)
) %>%
select(Type, Skill, score)
df = df %>%
expand(nesting(Type, Skill), score = 1:5) %>%
left_join(mutate(df, achieved = TRUE)) %>%
group_by(Type, Skill) %>%
mutate(achieved = lag(cumsum(coalesce(achieved, FALSE)) < 1, default = TRUE))
ggplot(df, aes(x = score, y = Skill, color = achieved)) +
geom_point(size = 2) +
facet_grid(rows = vars(Type), scales = "free") +
labs(x = "", y = "") +
scale_x_continuous(expand = expansion(add = 0.5)) +
scale_color_manual(values = c("gray90", "gray20"), guide = "none") +
ggthemes::theme_tufte(base_family = "Arial Black") +
theme(
axis.text.x = element_blank(),
axis.ticks = element_blank(),
strip.background = element_rect(fill = "gray90", color = NA)
)
I'd add commentary that a lot of what makes the original appealing is its simplicity. Stick to integer scores. Don't overdo it adding too many categories. And your current data is so low variance to be boring--if you give yourself nothing but 4s and 5s, there's not a lot of information there.
Upvotes: 2
Reputation: 651
Great Ideas. Here is what I came up with.
datAnal_skills$Type<-factor(datAnal_skills$Type,levels=c("Programming","Analytics","Personal"))
#
ggplot(datAnal_skills, aes(x = Of.10, y = reorder(Skill,Of.10))) +
geom_point(size = 3) + # Use a larger dot
facet_wrap(~Type,scales = "free_y")+
xlim(c(0,10))+
ylab("")+
xlab("")+
theme_bw() +
theme(
axis.text.x=element_blank(),
panel.grid.major.x = element_blank(),
panel.grid.minor.x = element_blank(),
panel.grid.major.y = element_line(colour = "grey60", linetype = "dashed")
)
Upvotes: 0
Reputation: 38013
You can first create a grid of points, then colour the point based on whether grid position is lower than the score. Example below is for the 10-point scale, as the 5 point scale aren't integers and don't translate to bullets very well.
library(ggplot2)
# df <- structure(...) # omitted for brevity
# For every skill, place 10 bullets
grid <- expand.grid(skill_id = seq_along(df$Skill), bullets = 1:10)
# Match skill name and score from original data
grid$score <- df$Of.10[grid$skill_id]
grid$skill <- df$Skill[grid$skill_id]
ggplot(grid, aes(factor(bullets), skill)) +
geom_point(aes(colour = bullets <= score), size = 3) +
scale_colour_manual(values = c("grey70", "grey30"),
guide = "none")
Upvotes: 1
Reputation: 79164
Something like this:
library(ggplot)
ggplot(df, aes(x=Skill, y=Type))+
geom_point(aes(size=Of.10))+
coord_flip()
Upvotes: 0