r - Selecting columns from data.table -
this question has answer here:
i trying select single column datatable. need array of values, , not data table single column.
currently casting data table dataframe, select desired column. ideas how can directly?
df = data.frame(a = 1:5, b = 6:10) class(df[,'a']) # integer - (desired format) class(df[,1]) # integer - (desired format) dt = data.table(df) class(dt[,'a', = f]) # "data.table" "data.frame" class(dt[,1, = f]) # "data.table" "data.frame" # cast dataframe , select class(as.data.frame(dt)[,'a']) # integer - (desired format)
you can try :
class(dt[,a]) # integer
Comments
Post a Comment