Convert data format in R -
i have data set, dat, got model run.
the head of dataset looks this:
[[1]] [1] -1 [[2]] [2] -2 [[3]] [3] -1 [[4]] [4] 0 [[5]] [5] -6 [[6]] [6] -7 how can convert dat simple data frame single column this
-1 -2 -1 0 -6 -7 thanks
dan
you want use unlist function. example:
unlist(list(1,2,3,4,5)) [1] 1 2 3 4 5 and can turn column cbinding results
a = unlist(list(1,2,3,4,5)) > cbind(a) [1,] 1 [2,] 2 [3,] 3 [4,] 4 [5,] 5
Comments
Post a Comment