Re: [R] column name changes based on substrings

2003-03-07 Thread Douglas Bates
"Jeremy Z Butler" <[EMAIL PROTECTED]> writes: > So far I can't even figure out how to replace a column name: > > >aa[colnames(aa)=="blah3.Mg"]_colnames("Mg (%)") > Error in matrix(value, n, p) : No data to replace in matrix(...) You replace the column names by replacing elements of the second co

[R] column name changes based on substrings

2003-03-06 Thread Jeremy Z Butler
Hi peoples, I'm trying to work out a function which will allow me to relace column names on the basis of substrings within the existing names. e.g. I'd like: blah.Na blah2.Na blah3.Mg blah4.Mg blah5.K blah6.K R1 x x x xxx R2 x x