R code for reading and writing files in libsvm format
The functions for reading and writing libsvm sparse format from R, rather slow. See read_example.r and write_example.r for usage.
This might also be helpful:
http://stackoverflow.com/questions/12112558/read-write-data-in-libsvm-format