Not sure why the data.frame function does not capture the name of the column field when its being built with only one column.

Can anyone help?



> data
  out pred1 predd2
1   1   2.0    3.0
2   2   3.5    5.5
3   3   5.5   11.0
> data1=data.frame(data[,1])
> data1
  data...1.
1         1
2         2
3         3
> data1=data.frame(data[,1:2])
> data1
  out pred1
1   1   2.0
2   2   3.5
3   3   5.5
> sessionInfo()
R version 2.5.1 (2007-06-27) 
i386-pc-mingw32 

locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

attached base packages:
[1] "stats"     "graphics"  "grDevices" "utils"     "datasets"  "methods"  
[7] "base"     
> 

	[[alternative HTML version deleted]]

