Start with the following data.table:
set.seed(1234)
dt <- data.table(x = runif(3), y = runif(3), z = runif(3))
print(dt)
And turn it into a list in the following structure:
print(dt2)
#[[1]]
#[1] 0.1137034 0.6233794 0.009495756
#
#[[2]]
#[1] 0.6222994 0.8609154 0.2325505
#
#[[3]]
#[1] 0.6092747 0.6403106 0.6660838
I studied the answers to this question , but could not figure out how to do this for all rows of the data table. without applying a cyclic function. I am trying to avoid a loop function due to the number of rows in the actual data table.
source
share