Removed NA removal since it is not needed

This commit is contained in:
Nora Wickelmaier 2024-04-26 12:35:01 +02:00
parent 0b067d8419
commit f39614b6cf
2 changed files with 3 additions and 23 deletions

View File

@ -9,7 +9,7 @@
# output: results/dataframes_case_2019.RData # output: results/dataframes_case_2019.RData
# results/centrality_cases.RData # results/centrality_cases.RData
# #
# last mod: 2024-04-17 # last mod: 2024-04-25
# setwd("C:/Users/nwickelmaier/Nextcloud/Documents/MDS/2023ss/60100_master_thesis/analysis/") # setwd("C:/Users/nwickelmaier/Nextcloud/Documents/MDS/2023ss/60100_master_thesis/analysis/")
@ -91,21 +91,6 @@ datcase$max_time <- NULL
artworks <- unique(dat$item)[!unique(dat$item) %in% c("501", "502", "503")] artworks <- unique(dat$item)[!unique(dat$item) %in% c("501", "502", "503")]
datcase$infocardOnly <- pbapply::pbsapply(dat_split, check_infocards, artworks = artworks) datcase$infocardOnly <- pbapply::pbsapply(dat_split, check_infocards, artworks = artworks)
# Clean up NAs
datcase$distance <- ifelse(is.na(datcase$distance), 0, datcase$distance)
datcase$scaleSize <- ifelse(is.na(datcase$scaleSize), 1, datcase$scaleSize)
datcase$rotationDegree <- ifelse(is.na(datcase$rotationDegree), 0, datcase$rotationDegree)
datcase$artist <- ifelse(is.na(datcase$artist), 0, datcase$artist)
datcase$details <- ifelse(is.na(datcase$details), 0, datcase$details)
datcase$extra_info <- ifelse(is.na(datcase$extra_info), 0, datcase$extra_info)
datcase$komposition <- ifelse(is.na(datcase$komposition), 0, datcase$komposition)
datcase$leben_des_kunstwerks <- ifelse(is.na(datcase$leben_des_kunstwerks), 0, datcase$leben_des_kunstwerks)
datcase$licht_und_farbe <- ifelse(is.na(datcase$licht_und_farbe), 0, datcase$licht_und_farbe)
datcase$technik <- ifelse(is.na(datcase$technik), 0, datcase$technik)
datcase$thema <- ifelse(is.na(datcase$thema), 0, datcase$thema)
datcase$ntopics <- ifelse(is.na(datcase$ntopics), 0, datcase$ntopics)
datcase$ntopiccards <- ifelse(is.na(datcase$ntopiccards), 0, datcase$ntopiccards)
#--------------- (3) Select features for navigation behavior --------------- #--------------- (3) Select features for navigation behavior ---------------
# Features for navigation types for MTT: # Features for navigation types for MTT:
@ -159,7 +144,7 @@ rm(tmp)
dattree$InfocardOnly <- factor(datcase$infocardOnly, levels = 0:1, dattree$InfocardOnly <- factor(datcase$infocardOnly, levels = 0:1,
labels = c("no", "yes")) labels = c("no", "yes"))
# Add pattern to datcase; loosely based on Bousbia et al. (2009) # Add pattern to dattree; loosely based on Bousbia et al. (2009)
dattree$Pattern <- "Dispersion" dattree$Pattern <- "Dispersion"
dattree$Pattern <- ifelse(dattree$PathLinearity > 0.8, "Scholar", dattree$Pattern <- ifelse(dattree$PathLinearity > 0.8, "Scholar",
dattree$Pattern) dattree$Pattern)

View File

@ -10,7 +10,7 @@
# output: ../thesis/results/clustering_cases_2018.RData # output: ../thesis/results/clustering_cases_2018.RData
# ../thesis/results/clustering_cases.RData # ../thesis/results/clustering_cases.RData
# #
# last mod: 2024-04-17 # last mod: 2024-04-25
# setwd("C:/Users/nwickelmaier/Nextcloud/Documents/MDS/2023ss/60100_master_thesis/analysis/") # setwd("C:/Users/nwickelmaier/Nextcloud/Documents/MDS/2023ss/60100_master_thesis/analysis/")
@ -61,11 +61,6 @@ datcase18$max_time <- NULL
artworks <- unique(dat$item)[!unique(dat$item) %in% c("501", "502", "503")] artworks <- unique(dat$item)[!unique(dat$item) %in% c("501", "502", "503")]
datcase18$infocardOnly <- pbapply::pbsapply(dat_split, check_infocards, artworks = artworks) datcase18$infocardOnly <- pbapply::pbsapply(dat_split, check_infocards, artworks = artworks)
# Clean up NAs
datcase18$distance <- ifelse(is.na(datcase18$distance), 0, datcase18$distance)
datcase18$scaleSize <- ifelse(is.na(datcase18$scaleSize), 1, datcase18$scaleSize)
datcase18$rotationDegree <- ifelse(is.na(datcase18$rotationDegree), 0, datcase18$rotationDegree)
#--------------- (3) Select features for navigation behavior --------------- #--------------- (3) Select features for navigation behavior ---------------
dattree18 <- data.frame(case = datcase18$case, dattree18 <- data.frame(case = datcase18$case,