Skip to content
Prev 307394 / 398506 Next

Convert COLON separated format

I have a bunch of data sets that were created for the libsvm tool.  They are in "colon separated sparse format".

i.e.

1  5:1  27:3  345:10

Is a row with the label of "1" and only has values in columns 5, 27, and 345.

I want to read these into a data.frame in R.  

Is there a simple way to do this?

--
Noah Silverman, M.S.
UCLA Department of Statistics
8117 Math Sciences Building
Los Angeles, CA 90095