Michael A. Miller
2004-May-20 16:13 UTC
[R] R 1.8.1 - 1.9.0 incompatability: Underscore in syntactically valid names
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 suggestions. Mike -- Michael A. Miller mmiller3 at iupui.edu Imaging Sciences, Department of Radiology, IU School of Medicine
Peter Dalgaard
2004-May-21 14:10 UTC
[R] R 1.8.1 - 1.9.0 incompatability: Underscore in syntactically valid names
mmiller3 at iupui.edu (Michael A. Miller) writes:> 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.Gah! I could swear we discussed that particular issue leading up to 1.9.x and had plans for a compatibility option. You might file a bug report at least for the docs, since the example is clearly wrong... -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907