R function for rtf output