and so sometimes you need to convert your tm object to a string vector for various reasons, the main one being handing it to the C++ method. It is ugly, but so it goes.
It is therefore a possibly better decision to pass a filename to a plain-text file
to the textreg call to be loaded by C++ directly.
See textreg.
convert.tm.to.character(corpus)