[R] Blank spaces are replaced by period in read.csv, I want to replace blacks with an underline

Sarah Goslee sarah.goslee at gmail.com
Mon Jun 8 16:23:00 CEST 2015


Easiest? Use sub() to replace the periods after the fact.

You can also use the check.names or the col.names arguments to
read.table() to customize your import.

Sarah

On Mon, Jun 8, 2015 at 10:15 AM, John Sorkin
<jsorkin at grecc.umaryland.edu> wrote:
> I am reading a csv file. The column headers have spaces in them. The spaces are replaced by a period. I want to replace the space by another character (e.g. the underline) rather than the period. Can someone tell me how to accomplish this?Thank you,
> John
>
> John David Sorkin M.D., Ph.D.
> Professor of Medicine
> Chief, Biostatistics and Informatics
> University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine
> Baltimore VA Medical Center
> 10 North Greene Street
> GRECC (BT/18/GR)
> Baltimore, MD 21201-1524
> (Phone) 410-605-7119
> (Fax) 410-605-7913 (Please call phone number above prior to faxing)
>
>
-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list