[R] Reading text files and readLine

From: Tuszynski, Jaroslaw W. <JAROSLAW.W.TUSZYNSKI_at_saic.com>
Date: Thu 26 May 2005 - 23:17:18 EST


I am trying to write a function to read in a whole text file as a single string ( so I can calculate its "sha1" hash function using package "digest"). I need a single string containing the whole file, and so far I was using paste(readLines(fileName), collapse = ""). Unfortunately this function gives me warnings :

        incomplete final line found by readLines on 'test2.xml'

due to lack of end-of-line character on the end of the file. Is there a way to suppress this warning? Or another function capable of reading whole text file into a string?


 Jarek Tuszynski, PhD.                               o / \ 
 Science Applications International Corporation  <\__,|  
 (703) 676-4192                        ">  \
 Jaroslaw.W.Tuszynski@saic.com                   `    \

	[[alternative HTML version deleted]]

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu May 26 23:23:32 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:07 EST