Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. data <- read.csv("/Users/ronzappardino/Downloads/keys_Indirect2.csv")
  2. View(data)
  3.  
  4. output <- rep(0, length(data$Item) * 4) # This is the vector you want to make
  5. for (i in 1: length(data$Item)) {
  6. if (data$Item[i] == "Critical") {
  7. output[i*4] <- "Critical_Direct"
  8. output[i*4 + 1] <- "Critical_Indirect"
  9. output[i*4 + 2] <- "Critical_Related_NonSequiter"
  10. output[i*4 + 3] <- "Critical_Unrelated"
  11. } else if (data$Item[i] == "Control") {
  12. output[i*4] <- "Control_Direct"
  13. output[i*4 + 1] <- "Control_Indirect"
  14. output[i*4 + 2] <- "Control_Related_NonSequiter"
  15. output[i*4 + 3] <- "Control_Unrelated"
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement