Guest User

Untitled

a guest
Dec 14th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. ggplot(data=d, aes(x=ID, y=Value)) + geom_line()
  2.  
  3. ggplot(data=d, aes(x=d$ID, y=d$Value)) +
  4. geom_line() +
  5. scale_x_discrete(breaks=1:8,
  6. labels=c("05/11", "29/11", "11/12", "23/12",
  7. "04/01", "16/01", "28/01", "09/02"))
  8.  
  9. > str(d)
  10. 'data.frame': 10 obs. of 4 variables:
  11. $ Value : num 0.021 0.0436 0.0768 0.0901 0.1128 ...
  12. $ Statistic: Factor w/ 1 level "Variable": 1 1 1 1 1 1 1 1 1 1
  13. $ ID : int 1 2 3 4 5 6 7 8 9 10
  14. $ Variable : chr "Mean_Sigma0_VV" "Mean_Sigma0_VV" "Mean_Sigma0_VV" "Mean_Sigma0_VV" ...
  15.  
  16. > dput(d)
  17. structure(list(Value = c(0.021008858735161, 0.0435905957091736,
  18. 0.0767780373205124, 0.0901182900951117, 0.11277978896612, 0.0990637045976107,
  19. 0.118897251291308, 0.10604101636234, 0.121525916187773, 0.104460360304768
  20. ), Statistic = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
  21. 1L), class = "factor", .Label = "Variable"), ID = 1:10, Variable = c("Mean_Sigma0_VV",
  22. "Mean_Sigma0_VV", "Mean_Sigma0_VV", "Mean_Sigma0_VV", "Mean_Sigma0_VV",
  23. "Mean_Sigma0_VV", "Mean_Sigma0_VV", "Mean_Sigma0_VV", "Mean_Sigma0_VV",
  24. "Mean_Sigma0_VV")), .Names = c("Value", "Statistic", "ID", "Variable"
  25. ), row.names = c(NA, -10L), class = "data.frame")
  26.  
  27. ggplot(data=d, aes(x=ID, y=Value)) +
  28. geom_line() +
  29. scale_x_continuous(breaks=1:8,
  30. labels=c("05/11", "29/11", "11/12", "23/12",
  31. "04/01", "16/01", "28/01", "09/02"))
  32.  
  33. d$ID <- factor(d$ID)
  34.  
  35. ggplot(data=d, aes(x = ID, y = Value, group = 1)) +
  36. geom_line() +
  37. scale_x_discrete(breaks=1:8,
  38. labels=c("05/11", "29/11", "11/12", "23/12",
  39. "04/01", "16/01", "28/01", "09/02"))
Add Comment
Please, Sign In to add comment