This blog will show the DV construction of an interactive correlation plot of the Marvel Cinematic Universe characters.

Data preparation

Firstly, we load the specific data of MCU characters and their calculated correlation dataframe.

load("~/COMM2501 Portfolio - z5218332/files/data_mcu.Rda")
load("~/COMM2501 Portfolio - z5218332/files/char_cor_mcu.Rda")

We first then want to extract the character names to label the correlation plot.

library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
character_list_mcu <- data_mcu %>% select(character_code, fictional_work, character_name) %>% distinct() %>% arrange(character_code) %>% select(character_name)

colnames(char_cor_mcu) <- as.character(character_list_mcu[,1])
rownames(char_cor_mcu) <- as.character(character_list_mcu[,1])

Correlation plot DV construction

## corrplot 0.92 loaded
## Loading required package: viridisLite

Displaying the correlation plot using ggiraph:

girafe(ggobj=corplot_mcu3)