2 Data

2.1 Overview

The data for the points distribution of the Poem Minigame were obtained from the Doki Doki Literature Club wiki,10 being stored in a comma-separated-values (CSV) file for importing into R–there are a total of 228 words recorded. What follows is the R code that loads the necessary libraries for analysis, importing and displaying the first few rows of the dataset (see Appendix A for the full display).

Each character can receive 1 to 3 points, depending on the player’s selection of the words. Generally speaking, Natsuki prefers “cute” and shorter words such as “boop,”" whereas Yuri opts for more complex ones such as “vivacious.” If a player picks something of the former, Natsuki receives more points and Yuri receives fewer (see Appendix B for visualizations of the point-distribution relationships between the characters). Sayori, on the other hand, prefers words that can be happy such as “awesome” or bittersweet such as “raincloud.”

The subsections Setup and Import below show the R code that loads the necessary libraries for analysis and import steps, respectively.

2.2 Setup

Before the analysis is conducted in R, a set of libraries are loaded for data management, presentation, and methodological purposes. First, the tidyverse library is loaded for its data management and plotting functions (primarily from dplyr and ggplot2), where magrittr is loaded for its convenient update pipe operator (%<>%) that allows one simultaneously to pass and update their data object. The libraries knitr and kableExtra are loaded so that the presentation of the tables can match closer to that of the APA style. The library broom is used to convert model and statistical test outputs into a data frame that knitr and kableExtra functions can accept. The gridExtra library is used to combine ggplot2 functions together. Finally, the FSA library is used to conduct Dunn’s Test as a post-hoc procedure to Kruskal-Wallis.11

For reproducibility purposes, a function try_load() is created: it attempts to find out whether a library has already been installed, and if not, attempts to install and load it. The function Map() is then used to iterate through loading the aforementioned libraries. Afterward, the next step is to import the data.

2.2.1 R Code: Setup

# Name libraries to use for analysis.
libs <- c('tidyverse',  # For data management.
          'magrittr',   # For data management.
          'knitr',      # For presenting tables.
          'kableExtra', # For presenting tables.
          'broom',      # For tidying models/tests.
          'gridExtra',  # For placing plots on a grid.
          'FSA')        # For Dunn's Test

# Write function for loading libraries or installing them if not available.
try_load <- function(x) { 
  
  if (!require(x, character.only = TRUE)) {
    
    install.packages(x)
    library(x, character.only = TRUE)
  
  }
  
}

# Load libraries
Map(try_load, libs)

2.3 Import

To import the dataset into R, we copy the data from the DDLC Poem Game wiki page12 and insert them into a CSV file. We then use the read.csv() function to import the data, maintaining that the column word is a character variable and not a factor. To preview the data, we apply the kable function fo the first five rows of the dataset, setting booktabs = TRUE so that we achieve a table with a clean look. The result is Table 1–see Appendix A for the full dataset.

2.3.1 R Code: Import

# Import Dataset 
## Saved data from the following link into a CSV: https://ddlcwiki.net/wiki/Poem_game)
data <- read.csv('ddlc.csv', stringsAsFactors = FALSE)

# Show the first few rows of the dataset
kable(head(data, 5), 
      booktabs = TRUE,
      caption = 'DDLC Points Distribution Data (First Five Rows)') %>%
  kable_styling(full_width = TRUE, latex_options = "hold_position") %>%
  footnote(general = 'https://ddlcwiki.net/wiki/Poem_game',
           general_title = 'Data Source:',
           footnote_as_chunk = TRUE)
Table 2.1: DDLC Points Distribution Data (First Five Rows)
Word Sayori Natsuki Yuri
adventure 3 2 1
afterimage 1 1 3
agonizing 2 1 3
alone 3 1 2
amazing 3 2 1
Data Source: https://ddlcwiki.net/wiki/Poem_game