Skip to content

Commit

Permalink
negative urgency scores now interpreted correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
jhollway committed Aug 21, 2024
1 parent 620de7a commit d3c0aaf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/sim_urgency.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ sim_urgency <- function(urgency,
combins <- merge(combins, time, by.x = "Var3", by.y = "word")
combins <- combins[,c("Var1","Var2","Var3","Rescaled.x","Rescaled.y","Rescaled")]
combins$combo <- as.numeric(combins$Rescaled.x) * combins$Rescaled.y * as.numeric(combins$Rescaled)
formul <- combins[which.min.diff(urgency, combins$combo),c("Var1","Var2","Var3")]
formul <- combins[which.min.diff(abs(urgency), combins$combo),c("Var1","Var2","Var3")]
if(urgency < 0) intcom <- c(formul[1:2], sample(c("not","never"),1)) else
intcom <- formul[1:2]
out <- paste(pronoun, paste(intcom, collapse = " "), "do this", formul[3])
Expand Down

0 comments on commit d3c0aaf

Please sign in to comment.