Guest User

Untitled

a guest
Nov 23rd, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. library(ggplot2)
  2. library(GGally)
  3.  
  4. #Function that returns a parallel coordinates plot
  5. PF1_PCPCRG <- function(datafile, title) {
  6. returnplot <-
  7. ggparcoord(
  8. # The Data file
  9. datafile,
  10. # Which columns from data file to use in the plot
  11. columns = c(3,8,56,9,69,42,43,38,29,30,31,6,36,146),
  12. # Which column to use for coloring data
  13. groupColumn = 3,
  14. # Do not show points
  15. showPoints = FALSE,
  16. # Turn on alpha blending for dense plots
  17. alphaLines = 0.6,
  18. # Turn off box shading range
  19. shadeBox = NULL,
  20. # Will normalize each column's values to [0, 1]
  21. scale = "std" # try "std" also
  22. ) +
  23.  
  24. # Decrease margins
  25. scale_x_discrete(expand = c(0.02, 0.02)) +
  26. scale_y_continuous(expand = c(0.02, 0.02)) +
  27.  
  28. # Plot ttitle
  29. ggtitle(title)
  30. }
  31.  
  32. # ------------------------------------------------------------------------------------------------
  33. # ------------------------------------------------------------------------------------------------
  34. #1 PC plot
  35. p_PCP <- PF1_PCPCRG (EndData5v6WS, "PC Plot")
  36. p_PCP
Add Comment
Please, Sign In to add comment