The R script in the link loads the text into a character vector, "text". Basically, it is a vector of documents.
Is there an easy way to apply document weights (if attached to the raw documents)? The weighting options in the documentation for "TermDocumentMatrix" do not seem to be relevant. One option is to use the weights to physically replicate the documents in "text".