"Gabor Grothendieck" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Would this be good enough:
>
> # example using builtin BOD data frame
> write.csv(cbind(Z = row.names(BOD), BOD), row.names = FALSE)

Thanks, Gabor,  I like your solution better than mine.

But, I still don't understand R's design and the lack of a column name for 
the row names. In R all database tables represented by a data.frame have a 
blank key name.  This missing column name is the database "key".  Having a 
mnemonic, non-blank, name for this "key"  would be an improvement IHMO.

I don't always have normalized data (in the database sense, 
http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=104, 
"Database Normalization") but R's lack of a key name makes keeping track of 
data more difficult, and makes communication about any database 
normalization more difficult.  If one is using a database schema for 
selecting data, and paying careful attention to the keys, the key names are 
simply lost while in R.  Why?

I'm trying to politely challenge the design of R's current default behavior. 
Now we've got to do extra work to communicate necessary information, which 
doesn't make sense to me.  The default behavior should be to communicate 
necessary information -- the key name --  instead of hiding it

efg

______________________________________________
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.

Reply via email to