---
title: "HLA22 Keyword Network"
output: html_document
---
## Packages
```{r}
library(bibliometrix)
library(tidyverse)
library(igraph)
```

## Step 1. Dowload Data from Web of Science Source Collection
If using the data included (hla22_chapter1_data.rds) skip to step 4

https://mjl.clarivate.com/home
Search term = "learning analytics"

## Step 2. Load Data
```{r}
file <- "savedrecs.txt"

#Convert to network file
M <- convert2df(file, dbsource = "wos", format = "plaintext")

#Create summary of network
results <- biblioAnalysis(M, sep = ";")

S <- summary(object = results, k = 100, pause = FALSE)

```

## Step 3. Clean up author keywords
```{r}
#Remove the keyword "learning analytics"
M$DE <- gsub("LEARNING ANALYTICS", "", M$DE)

#Remove mispellings and punctuation
M$DE <- gsub("(LA);", "", M$DE)
M$DE <- gsub("[()];", "", M$DE)
M$DE <- gsub("COMPUTER-SUPPORTED COLLABORATIVE LEARNING", "COLLABORATION", M$DE)
M$DE <- gsub("COMPUTER-SUPPORTED COLBORATIVE LEARNING", "COLLABORATION", M$DE)
M$DE <- gsub("CSSIFICATION", "CLASSIFICATION", M$DE)
M$DE <- gsub("COLBORATION","COLLABORATION", M$DE)
M$DE <- gsub("NATURAL NGUAGE PROCESSING","NLP", M$DE)

#Standardize as abbreviations
M$DE <- gsub("LEARNING MANAGEMENT SYSTEMS", "LMS", M$DE)
M$DE <- gsub("LEARNING MANAGEMENT SYSTEM", "LMS", M$DE)
M$DE <- gsub("MASSIVE OPEN ONLINE COURSE","MOOC", M$DE)
M$DE <- gsub("MASSIVE OPEN ONLINE COURSES","MOOC", M$DE)
M$DE <- gsub("MOOCS","MOOC", M$DE)

#Group similar terms
M$DE <- gsub("STUDENT PERFORMANCE", "PERFORMANCE", M$DE)
M$DE <- gsub("ACADEMIC PERFORMANCE", "PERFORMANCE", M$DE)
M$DE <- gsub("EDUCATIONAL DATA MINING","DATA MINING", M$DE)
M$DE <- gsub("COLLABORATIVE LEARNING","COLLABORATION", M$DE)
M$DE <- gsub("CSCL","COLLABORATION", M$DE)
M$DE <- gsub("SOCIAL NETWORK ANALYSIS","SNA;", M$DE)
M$DE <- gsub("SOCIAL NETWORKS","SNA", M$DE)
M$DE <- gsub("SELF-REGUTED LEARNING","SRL", M$DE)
M$DE <- gsub("SELF-REGULATED LEARNING","SRL", M$DE)
M$DE <- gsub("SELF-REGULATION","SRL", M$DE)
M$DE <- gsub("HIGHER EDUCATION","HIGHER ED", M$DE)
M$DE <- gsub("DISTANCE EDUCATION","DISTANCE ED", M$DE)
M$DE <- gsub("ENGINEERING EDUCATION","ENGINEERING ED", M$DE)
M$DE <- gsub("VISUAL ANALYTICS","VISUALIZATION", M$DE)
M$DE <- gsub("DATA VISUALIZATION","VISUALIZATION", M$DE)
M$DE <- gsub("INFORMATION VISUALIZATION","VISUALIZATION", M$DE)
M$DE <- gsub("VISUALIZATIONS","VISUALIZATION", M$DE)
M$DE <- gsub("ELEARNING","E-LEARNING", M$DE)
M$DE <- gsub("TECHNOLOGY-ENHANCED LEARNING","TECHNOLOGY ENHANCED LEARNING", M$DE)
M$DE <- gsub("VIRTUAL LEARNING ENVIRONMENTS", "VIRTUAL LEARNING ENVIRONMENT", M$DE)

```

## Step 4. Save data and open in Biblioshiny
```{r}
saveRDS(M, "hla22_chapter1_data.rds")

biblioshiny()

```

a. Click "Data" -> "Import or Load files" and upload your .rds file

b. Check summary stats and then to recreate the author keyword network click "Conceptual structure" -> "Co-occurence network"

Field = "Author's keywords"

Show Network Parameters

Network Layout = Fruchtermann & Reingold
Clustering = Leading Eigenvalues
Normalization = association
Node Color by Year = No
Number of Nodes = 80
Repulsion Force = 0.2
Remove Isolated Nodes = Yes
Minimum number of Edges = 2

Show Graphical Parameters

Opacity = 0.7
Number of labels = 80
Label cex = Yes
Node Shape = Dot
Label size = 6
Edge Size = 5
Node shadow = No
Curved edges = No

