forked from focods/dataExplainedProject
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTesting.Rmd
More file actions
54 lines (46 loc) · 1.03 KB
/
Copy pathTesting.Rmd
File metadata and controls
54 lines (46 loc) · 1.03 KB
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
---
title: "Data Explained Project - Testing"
output: html_document
---
```{r setup, include=FALSE,message=FALSE,warning=FALSE}
library(tidyverse)
library(ggplot2)
library(plotly)
data = read.csv('edge1.1.csv')
```
```{r}
knitr::kable(colnames(data))
```
```{r}
p = ggplot(data,
aes(x=Male_Contributions,
y=Female_Contributions))
p + geom_point() + facet_wrap(~Discipline)
```
```{r,fig.height=6}
df = data
df$mine = as.integer(as.character(df$PhD_Year))
p = ggplot(df %>% filter(mine != 'NA'),
aes(x=Male_Contributions,
y=Female_Contributions))
p + geom_point() + facet_wrap(~PhD_Year)
```
```{r}
plotRank = function(GROUP){
x.string=GROUP
df = data %>%
group_by_(GROUP) %>%
summarise(n = n()) %>%
arrange(-n) %>%
top_n(20)
p = ggplot(df,aes_string(x=x.string,y='n'))
p + geom_bar(stat='identity') + coord_flip()
}
plotRank('Title')
plotRank('Department')
plotRank('Id')
plotRank('PhD_Institution')
plotRank('PhD_Field')
plotRank('PhD_Year')
plotRank('Discipline')
```