Combined into single R script; writes all strings as characters.