[R] request/suggestion: modified names

From: Ritter, Christian C GSMCIL-GSTMS/2 <christian.ritter_at_shell.com>
Date: Thu 30 Jun 2005 - 18:16:59 EST


For some time now I use a modified version of names (extract direction) of the following type: Names<-
function (x,filter="^")
{

        grep(filter,names(x),value=TRUE) }

Request:
Has anyone already written a version which goes the other way (that is, which allows assignment of the type Names(x,filter)<-...). Naive versions are obvious, but I think something would have to be done to check validity. So if anyone has already done it for me, I would be very happy if you could share it. Such a function would be quite useful when working with large data frames (as I typically do) and need to edit names in a convenient way.

Suggestion:
Wouldn't the filter argument make sense in general, that is in "names" and not only in a custom version "Names"?

Have a nice day,

Christian Ritter
Functional Specialist Statistics
Shell Coordination Centre S.A.
Monnet Centre International Laboratory, Avenue Jean Monnet 1, B-1348 Louvain-La-Neuve, Belgium

Tel: +32 10 477 349 Fax: +32 10 477 219 Email: christian.ritter@shell.com
Internet: http://www.shell.com/chemicals

        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Jun 30 18:22:04 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:07 EST