Answers for "putting data in a table in r"

0

putting data in a table in r

DT = data.table(
  ID = c("b","b","b","a","a","c"),
  a = 1:6,
  b = 7:12,
  c = 13:18
)
DT
#    ID a  b  c
# 1:  b 1  7 13
# 2:  b 2  8 14
# 3:  b 3  9 15
# 4:  a 4 10 16
# 5:  a 5 11 17
# 6:  c 6 12 18
class(DT$ID)
# [1] "character"
Posted by: Guest on June-20-2021

Code answers related to "putting data in a table in r"

Browse Popular Code Answers by Language