On 26/10/2010 10:33 AM, Donald Braman wrote:
I'm importing a lot of text tables of data (from Latent Gold) that includes
hashes in some of the column names ("Cluster#1", "Cluster#2", etc.).  Is
there an easy way to strip the offending hashes out before pushing the text
into a table or data frame?  I thought I'd use gsub, e.g., but can't figure
out how to read in a text file without reading it into a table or data frame
(which would be ill structured, given the hashes).  I could do it in another
scripting language or shell script, but would like to try to do it in R.

readLines() will read it, but you may not need to do that. Set comment.char="" to turn off the special meaning of # in read.table() and related functions.

Duncan

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to