[R] Avoiding "." when importing from csv

Frank E Harrell Jr f.harrell at vanderbilt.edu
Mon Dec 31 15:47:10 CET 2007


Prof Brian Ripley wrote:
> See the help, especially argument 'check.names'.
> 
> On Sat, 29 Dec 2007, Thomas Schwander wrote:
> 
>> Hi guys, another question today:
>>
>>
>>
>> If I import an external csv-file with headers (with read.csv2), the blanks
>> are interpreted as points. So "Test 1" becomes "Test.1".
>>
>>
>>
>> Is there a way to change this?
>>
>>
>>
>> Thanks,
>>
>> Thomas

Depending on the ultimate need, you can also use the csv.get function in 
the Hmisc package.  csv.get keeps the original column names as variable 
labels, then transforms the names to become legal R names as with 
read.csv.  In the new version there is also an option to read the 
variable labels from another row.

Frank Harrell



More information about the R-help mailing list