> seen
# muid seenmonth 54249 54371 55392 55546 55326 57003 45907 45428
# 1: 48562130 1 0 1 1 1 0 1 0 0
# 2: 48562131 1 1 0 0 1 1 0 1 1
# 3: 48562132 1 1 1 1 0 0 0 1 1
# 4: 48562133 1 0 1 0 1 1 1 0 0
# 5: 48562134 1 1 0 1 0 0 1 0 0
> seen.m<-melt(seen,id.vars=c('muid','seenmonth'))
> str(seen.m)
Classes ‘data.table’ and 'data.frame': 7192 obs. of 4 variables:
# $ muid : int 48562130 48562131 48562132 48562133 48562134 48562135 48562136 48562137 48562138 48562139
# $ seenmonth: int 1 1 1 1 1 1 1 1 1 1 ...
# $ variable : Factor w/ 31 levels "54249","54371",..: 1 1 1 1 1 1 1 1 1 1 ...
# $ value : int 0 1 1 0 1 0 0 0 1 0 ...
# - attr(*, ".internal.selfref")=<externalptr>
In str(seen.m)
, "variable" is factor. I want this as numeric or character. Is it possible?