-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
w12_PrgL.qmd
100 lines (76 loc) · 1.56 KB
/
w12_PrgL.qmd
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
---
title: "TidyTuesday 2023 w12 Programming Languages"
author: "Federica Gazzelloni"
execute:
comments: ""
eval: true
echo: true
warning: false
message: false
---
```{r}
library(tidyverse)
tuesdata <- tidytuesdayR::tt_load(2023, week = 12)
```
```{r}
languages <- tuesdata$languages
```
```{r}
write_csv(languages,"languages.csv")
```
```{r}
languages%>%head
```
```{r}
languages%>%names
```
```{r}
df <- languages%>%
arrange(appeared)%>%
select(pldb_id,appeared,type,language_rank,number_of_users)
df
```
```{r}
ggplot(df,aes(appeared,language_rank))+
geom_point()
```
```{r}
df %>%
filter(appeared>1900)%>%
ggplot(aes(appeared,language_rank))+
geom_point()+
scale_y_reverse()
```
```{r}
df %>%
count(type,sort = TRUE)%>%
mutate(pct=round(n/sum(n)*100,2))
```
```{r}
df %>%
arrange(-appeared)%>%
filter(between(appeared,2021,2023))%>%#count(type)
mutate(appeared=as.factor(appeared))
```
```{r}
df %>%
arrange(-appeared)%>%
filter(between(appeared,2021,2023))%>%#count(type)
mutate(appeared=as.factor(appeared))%>%
ggplot(aes(appeared,number_of_users,fill=type))+
geom_col()+
labs(title="New Language tools")
```
```{r}
df%>%
group_by(appeared)%>%
reframe(n_languages=n(),pldb_id,type,avg=mean(number_of_users))%>%
filter(between(appeared,2000,2023)) %>%
ggplot(aes(appeared,n_languages))+
geom_point()+
geom_line()+
geom_segment(aes(x=appeared,xend=appeared,y=0,yend=n_languages,
color=n_languages),
size=6)+
geom_text(aes(label=type),check_overlap = TRUE,vjust=-0.5)
```