Skip to content
Prev 363596 / 398502 Next

How to split a data.frame into its columns?

This is a bit of a puzzle since data.frame objects are by definition "lists of columns".

If you want a data.frame object (say it's name is dat) to _only be a list of columns then

dat <- unclass(dat)

The split.data.frame function splits by rows since that is the most desired and expected behavior and because the authors of S/R probably thought there was no point in making the split "by columns" when it already was.