dt.ls2c | R Documentation |
Replaces data.table columns of type list to a column of type vector in-place.
dt.ls2c(DT, column.names = NULL)
DT |
A |
column.names |
A |
A data.table
.
Yoann Pageaud.
dtbl<-data.table( col1 = rev(seq(16)), col2=as.list(rep(x = c("hello", "world"), 8))) #'col2' is of type 'list'. dt.ls2c(DT = dtbl) #All columns of type 'list' are converted into vectors. dt.ls2c(DT = dtbl, column.names = "col2") #Only 'col2' is converted into a vector.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.