Markus Loecher <markus.loecher <at> gmail.com> writes: > [...] > > x > ID X1 X2 > 1 010007787048271871 1 4 > 2 1007109516820319 2 3 > 3 10094843652996959 3 2 > 4 010145176274075487 4 1 > > The first column was not read in as a string, which mangled the IDs. > I could use colClasses explicitly, but then I would need to know the number > and classes of the remaining columns in advance. > Is this a bug or expected behavior ? > Any advice would be most helpful.
You could use a generic colClasses for all columns, like: y <- read.table("tmp.txt", header= TRUE, row.names=1, colClasses="character") y X1 X2 010007787048271871 1 4 1007109516820319 2 3 10094843652996959 3 2 010145176274075487 4 1 In this case, all columns are read as character and need to be converted manually, but your row names are appropriate. Hoping this helps, Adrian ______________________________________________ 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.