Guest User

Untitled

a guest
Nov 21st, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. library(ahp)
  2. library(data.tree)
  3. vacation <- Load("vacation.ahp")
  4.  
  5. # look at the structure
  6.  
  7. vacation
  8.  
  9.  
  10. # look at some preference dfs
  11.  
  12. vacation$preferences$Dad$pairwise$preferences
  13.  
  14. # manipulate preferences by code
  15. newprefs <- structure(list(c1 = list("Costs", "Costs", "Fun"), c2 = list(
  16. "Fun", "Spa", "Spa"), preference = c(7, 2, 3)), .Names = c("c1",
  17. "c2", "preference"), row.names = c(NA, -3L), class = "data.frame")
  18. vacation$preferences$Dad$pairwise$preferences <- newprefs
  19.  
  20. # reset voting powers by code (power to the children!):
  21. vacation$`decision-makers` <- c(Dad = 0.1, Mom = 0.2, Kid = 0.7)
  22. # ...except maybe for spa, that's still Mom's territory
  23. vacation$Spa$`decision-makers` <- c(Dad = 0.2, Mom = 0.7, Kid = 0.1)
  24.  
  25. Calculate(vacation)
  26.  
  27.  
  28. ahp::Analyze(vacation)
Add Comment
Please, Sign In to add comment