Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. # This is just c(red, grey, green)
  2. my_colour_pal <- c("#bc0303", "#4b5566", "#17a008")
  3. df <-
  4. data.frame(Group1 = c("one", "one", "two"),
  5. Group2 = c("val1", "val2", "val3"),
  6. Value = c(10, 10, 10),
  7. Colour = c(-1, 0, 1), stringsAsFactors = FALSE)
  8.  
  9. treemap(df, index = c("Group1", "Group2"), type = "value",
  10. vSize = "Value", vColor = "Colour", palette = my_colour_pal)
  11.  
  12. df <-
  13. data.frame(Group1 = c("one", "one", "two"),
  14. Group2 = c("val1", "val2", "val3"),
  15. Value = c(10, 0, 10),
  16. Colour = c(-1, 0, 1), stringsAsFactors = FALSE)
  17.  
  18. treemap(df, index = c("Group1", "Group2"), type = "value",
  19. vSize = "Value", vColor = "Colour", palette = my_colour_pal)
  20.  
  21. df <-
  22. data.frame(Group1 = c("one", "one", "two"),
  23. Group2 = c("val1", "val2", "val3"),
  24. Value = c(0, 0, 10),
  25. Colour = c(-1, 0, 1), stringsAsFactors = FALSE)
  26.  
  27. treemap(df, index = c("Group1", "Group2"), type = "value",
  28. vSize = "Value", vColor = "Colour", palette = my_colour_pal)
  29.  
  30. Error in do.call("format", args.legend) : second argument must be a list
  31.  
  32. my_colour_pal <- c("#bc0303", "#4b5566", "#17a008")
  33. df <-
  34. data.frame(Group1 = c("one", "one", "two"),
  35. Group2 = c("val1", "val2", "val3"),
  36. Value = c(10, 10, 0),
  37. Colour = c(-1, 0, 1), stringsAsFactors = FALSE)
  38.  
  39. treemap(df, index = c("Group1", "Group2"), type = "value",
  40. vSize = "Value", vColor = "Colour", palette = my_colour_pal)
  41.  
  42. df <-
  43. data.frame(Group1 = c("one", "one", "two"),
  44. Group2 = c("val1", "val2", "val3"),
  45. Value = c(10, 10, 0),
  46. Colour = c(-1, -1, 1), stringsAsFactors = FALSE)
  47.  
  48. treemap(df, index = c("Group1", "Group2"), type = "value",
  49. vSize = "Value", vColor = "Colour", palette = my_colour_pal)
  50.  
  51. Error in do.call("format", args.legend) : second argument must be a list
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement