### EXCURSUS
# depending on the encoding of the files and your operating system, scan may not work with, say, multibyte characters such as ""
a.file <- scan("files/multibytes.txt" , what=character(), sep="\n")
tolower(a.file) # error message on Linux

# in that case, use scan with the fileEncoding argument or
# use a connection with file (with an encoding argument) and readLines:
a.connection <- file("files/multibytes.txt", open="r", encoding="ISO-8859-15") # frequently used for Western European encodings
a.file <- readLines(a.connection)
close(a.connection)

tolower(a.file) # now it works
