1. PREPARE

Data Source

✅ Comprehension Check

Based on your reading, what’s the data source in this paper?

The authors reviewed literature on computational thinking in education and collected any definitions of CT that were published. These definitions were then collected into a single document, which they used for text analysis.

1b. Guiding Questions

✅ Comprehension Check

What’s the research question in this paper? Why is text network analysis an appropriate methodology to address the research question?

Their stated research questions are:

  1. What is the relationship between programming and CT, based on the definitions of the latter?

    a. Does programming arise as a fundamental core of CT?

    b. And what about the relationship between CT and robotics?

  2. In addition, how different are the definitions of CT proposed during the last years?

    a. Do they share some common characteristics?

    b. Or are they focused on distinct dimensions of this competence?

1c. Set Up

library(dplyr)
library(tidytext)
library(tidyverse)
library(tidyr)
library(ggplot2)
library(igraph)
library(ggraph)

2. WRANGLE

2a. Import Data

CTdefinition <- read_csv("data/definition.csv")
## Rows: 8 Columns: 1
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): definition
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

2b. Tokenizing text into bigrams

ct_bigrams <- CTdefinition %>%
  unnest_tokens(bigram, definition, token = "ngrams", n = 2)
ct_bigrams %>%
  count(bigram, sort = TRUE)
## # A tibble: 452 × 2
##    bigram               n
##    <chr>            <int>
##  1 computer science     5
##  2 ct is                5
##  3 is a                 5
##  4 a computer           4
##  5 can be               4
##  6 problem solving      4
##  7 that can             4
##  8 a problem            3
##  9 in a                 3
## 10 of computer          3
## # ℹ 442 more rows

2c. Remove stop words

bigrams_separated <- ct_bigrams %>%
  separate(bigram, c("word1", "word2"), sep = " ")

bigrams_filtered <- bigrams_separated %>%
  filter(!word1 %in% stop_words$word) %>%
  filter(!word2 %in% stop_words$word)

bigram_counts <- bigrams_filtered %>% 
  count(word1, word2, sort = TRUE)

bigram_counts
## # A tibble: 86 × 3
##    word1       word2             n
##    <chr>       <chr>         <int>
##  1 computer    science           5
##  2 solving     methodology       2
##  3 solving     process           2
##  4 abstraction automation        1
##  5 abstraction decomposition     1
##  6 abstraction recursion         1
##  7 algorithmic notions           1
##  8 algorithmic thinking          1
##  9 analysis    ct                1
## 10 analyze     data              1
## # ℹ 76 more rows
bigrams_united <- bigrams_filtered %>%
  unite(bigram, word1, word2, sep = " ")

bigrams_united
## # A tibble: 92 × 1
##    bigram                 
##    <chr>                  
##  1 people engaged         
##  2 computer hobbyist      
##  3 hobbyist clubs         
##  4 running computer       
##  5 computer drop          
##  6 computers simply       
##  7 shareable kinds        
##  8 integrate computational
##  9 computational thinking 
## 10 everyday life          
## # ℹ 82 more rows

3. VISUALIZE WORD NETWORK

bigram_graph <- bigram_counts %>%
  graph_from_data_frame()

bigram_graph
## IGRAPH 8a0f197 DN-- 117 86 -- 
## + attr: name (v/c), n (e/n)
## + edges from 8a0f197 (vertex names):
##  [1] computer       ->science       solving        ->methodology  
##  [3] solving        ->process       abstraction    ->automation   
##  [5] abstraction    ->decomposition abstraction    ->recursion    
##  [7] algorithmic    ->notions       algorithmic    ->thinking     
##  [9] analysis       ->ct            analyze        ->data         
## [11] analyzing      ->data          applicable     ->attitude     
## [13] artifacts      ->ct            automating     ->solutions    
## [15] broad          ->story         broader        ->discipline   
## + ... omitted several edges
bigram_graph_filtered <- bigram_counts %>%
  filter(n > 1) %>%
  graph_from_data_frame()

bigram_graph_filtered
## IGRAPH 50d640f DN-- 5 3 -- 
## + attr: name (v/c), n (e/n)
## + edges from 50d640f (vertex names):
## [1] computer->science     solving ->methodology solving ->process
set.seed(100)

a <- grid::arrow(type = "open", length = unit(.2, "inches"))

ggraph(bigram_graph, layout = "fr") +
  geom_edge_link(aes(edge_alpha = n), show.legend = FALSE,
                 arrow = a, end_cap = circle(.07, 'inches')) +
  geom_node_point(color = "red", size = 3) +
  geom_node_text(aes(label = name), vjust = 1, hjust = 1) +
  theme_void()
## Warning: Using the `size` aesthetic in this geom was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` in the `default_aes` field and elsewhere instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.

✅ Comprehension Check

Revise the code in the previous code chunk so that there are no arrows. The graph shows lines instead of arrows.

set.seed(100)

a <- grid::arrow(type = "open", length = unit(.2, "inches"))

ggraph(bigram_graph, layout = "fr") +
  geom_edge_link(aes(edge_width = n), show.legend = FALSE) +
  geom_node_point(color = "red", size = 3) +
  geom_node_text(aes(label = name), vjust = 1, hjust = 1) +
  theme_void()

set.seed(100)

a <- grid::arrow(type = "closed", length = unit(.2, "inches"))

ggraph(bigram_graph_filtered, layout = "fr") +
  geom_edge_link(aes(edge_alpha = n), show.legend = FALSE,
                 arrow = a, end_cap = circle(.07, 'inches')) +
  geom_node_point(color = "red", size = 3) +
  geom_node_text(aes(label = name), vjust = 1, hjust = 1) +
  theme_void()