It appears that you might not be specifying the sizes correctly. The :
operator has a very high priority. You might try
container <- create_container(doc_matrix, rawTags,
trainSize=1:(0.8*nrow(tagsSub)),
testSize=(0.8*nrow(tagsSub)+1):nrow(tagsSub),
virgin=FALSE
)