Guest User

Untitled

a guest
Nov 13th, 2017
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.18 KB | None | 0 0
  1. DT <- fread("ID,Group
  2. 1,2
  3. 2,5
  4. 3,35")
  5. DT[ , group2 := gsub("(\\d)(.+)", "\\1,\\2", DT$Group)]
  6. #    ID Group group2
  7. # 1:  1     2      2
  8. # 2:  2     5      5
  9. # 3:  3    35    3,5
Advertisement
Add Comment
Please, Sign In to add comment