## ----include = FALSE---------------------------------------------------------- knitr::opts_chunk$set( collapse = TRUE, comment = "#>", eval = FALSE ) ## ----------------------------------------------------------------------------- # library(leadeR) # library(data.table) # # spacyr::spacy_initialize() # set.seed(02138) # # own_ent <- "United States" # B <- 1000 # # jfk1 <- clean_text(jfk19610120) # jfk2 <- clean_text(jfk19610925) # jfk3 <- clean_text(jfk19630610) ## ----------------------------------------------------------------------------- # res_lta <- data.table::rbindlist( # lapply(c(jfk1, jfk2, jfk3), function(x) # get_lta(own_entity = own_ent, text = x, bootstrap = TRUE, B = B)) # ) # # print(res_lta) ## ----------------------------------------------------------------------------- # res_nat <- get_nat(own_entity = own_ent, text = jfk1, bootstrap = TRUE, B = B) # res_ctrl <- get_ctrl(own_entity = own_ent, text = jfk1, bootstrap = TRUE, B = B) # res_power <- get_power(own_entity = own_ent, text = jfk1, bootstrap = TRUE, B = B) # res_aff <- get_aff(own_entity = own_ent, text = jfk1, bootstrap = TRUE, B = B) # res_dist <- get_dist(own_entity = own_ent, text = jfk1, bootstrap = TRUE, B = B) # res_complex <- get_complex(text = jfk1, bootstrap = TRUE, B = B) # res_conf <- get_conf(text = jfk1, bootstrap = TRUE, B = B) # res_task <- get_task(text = jfk1, bootstrap = TRUE, B = B) ## ----------------------------------------------------------------------------- # # Simple mean # type_lta(res_lta) # # # Precision-weighted # type_lta(res_lta, precision_weighted = TRUE) ## ----------------------------------------------------------------------------- # out_lta <- type_lta(res_lta, precision_weighted = TRUE) # out_lta[, c("constraint", "openness", "motivation_toward_world", "typology")] ## ----------------------------------------------------------------------------- # type_lta( # res_lta, # precision_weighted = TRUE, # need_for_power = 0.50, # control = 0.44, # complex_high = 0.56, # confidence_high = 0.81, # task = 0.59, # distrust = 0.41, # ingroup = 0.42 # )