Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x <- data.frame(a= 1:11, b =3:13, c=2:12, d=7:17, invoice = 1:11)
- x =
- a b c d invoice
- 1 3 2 7 1
- 2 4 3 8 2
- 3 5 4 9 3
- 4 6 5 10 4
- 5 7 6 11 5
- 6 8 7 12 6
- 7 9 8 13 7
- 8 10 9 14 8
- 9 11 10 15 9
- 10 12 11 16 10
- 11 13 12 17 11
- y <- data.frame(nr = 100:125, invoice = 1)
- y$invoice[12:26] <- 2
- > y
- nr invoice
- 100 1
- 101 1
- 102 1
- 103 1
- 104 1
- 105 1
- 106 1
- 107 1
- 108 1
- 109 1
- 110 1
- 111 2
- 112 2
- 113 2
- 114 2
- 115 2
- 116 2
- 117 2
- > output
- nr invoice letter_count
- 100 1 1
- 101 1 3
- 102 1 2
- 103 1 7
- 104 1 1
- 105 1 3
- 106 1 2
- 107 1 7
- 108 1 1
- 109 1 2
- 110 1 7
- 111 2 2
- 112 2 4
- 113 2 3
- 114 2 8
- 115 2 2
- 116 2 4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement