[R] R 1.8.1 - 1.9.0 incompatability: Underscore in syntactically valid names

Michael A. Miller mmiller3 at iupui.edu
Thu May 20 18:13:42 CEST 2004

Dear R-gang,

I have a question about handling underscores in names in R 1.8.1
and 1.9.0.  I recently installed 1.9.0 on a machine and found
that many codes no longer work as a result of the changed
behavior in make.names.

I have numerous data files that have dashes, periods and
underscores in the header row.  I've got numerous R codes that
read those files with read.table and read.csv and then use the
names expecting the underscores and dashes to be changed to
periods in the column names.  Since this no longer happens in
1.9.0, lots of codes are failing.  One way to work around this is
to repair a lot of codes to take this backward incompatibility
into account (both R scripts and data sources, so that is a
significant project, here at least).  Or I can stay with 1.8.1,
but that is just a sure route to eventual incomparability with
something else, so I'll gradually start migrating code over and
adding version checks.

Can anyone suggest a way to maintain compatibility between R
versions?  I suppose I could write a wrapper around make.names to
replace _ with ., but I'm not sure what that might break in 1.9.0
that now expects the new behavior.  I'd appreciate any


Michael A. Miller                               mmiller3 at iupui.edu
  Imaging Sciences, Department of Radiology, IU School of Medicine

More information about the R-help mailing list