processing_section <- function(x){
unlist(strsplit(tolower(x), “\\W”))

lf <- list.files(pattern=”.txt”)
lapply(lf, function(path) processing_section(scan(path, what=”character”, sep=”\n”)))

A huge ‘Thank You’ (Merci) to Vincent Bonhomme who helped me with this code: I can now read in any number of pupil text files and have them stripped and ready for processing – frequency analysis, unique word count, etc – by simply indexing the array/table/data frame/list structure.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s