Advertisement
Guest User

Untitled

a guest
Jul 24th, 2017
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. x <- data.frame(a= 1:11, b =3:13, c=2:12, d=7:17, invoice = 1:11)
  2. x =
  3. a b c d invoice
  4. 1 3 2 7 1
  5. 2 4 3 8 2
  6. 3 5 4 9 3
  7. 4 6 5 10 4
  8. 5 7 6 11 5
  9. 6 8 7 12 6
  10. 7 9 8 13 7
  11. 8 10 9 14 8
  12. 9 11 10 15 9
  13. 10 12 11 16 10
  14. 11 13 12 17 11
  15.  
  16.  
  17. y <- data.frame(nr = 100:125, invoice = 1)
  18. y$invoice[12:26] <- 2
  19.  
  20. > y
  21. nr invoice
  22. 100 1
  23. 101 1
  24. 102 1
  25. 103 1
  26. 104 1
  27. 105 1
  28. 106 1
  29. 107 1
  30. 108 1
  31. 109 1
  32. 110 1
  33. 111 2
  34. 112 2
  35. 113 2
  36. 114 2
  37. 115 2
  38. 116 2
  39. 117 2
  40.  
  41. > output
  42. nr invoice letter_count
  43. 100 1 1
  44. 101 1 3
  45. 102 1 2
  46. 103 1 7
  47. 104 1 1
  48. 105 1 3
  49. 106 1 2
  50. 107 1 7
  51. 108 1 1
  52. 109 1 2
  53. 110 1 7
  54. 111 2 2
  55. 112 2 4
  56. 113 2 3
  57. 114 2 8
  58. 115 2 2
  59. 116 2 4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement