Henrique Dallazuanna wrote:
Try this:
gsub("^M{1}", "MOLE", names(data))
{1} is inessential here.
vQ
On Thu, Jun 18, 2009 at 8:24 PM, Mark Na wrote:
Dear R-helpers,
I would like to adapt the following code
names(data)<-sub("M","MOLE",names(data))
which changes any o
Try this:
gsub("^M{1}", "MOLE", names(data))
On Thu, Jun 18, 2009 at 8:24 PM, Mark Na wrote:
> Dear R-helpers,
>
> I would like to adapt the following code
>
> > names(data)<-sub("M","MOLE",names(data))
>
> which changes any occurrence of "M" (in my variable names) to "MOLE"
>
> such that it ON
Dear R-helpers,
I would like to adapt the following code
> names(data)<-sub("M","MOLE",names(data))
which changes any occurrence of "M" (in my variable names) to "MOLE"
such that it ONLY operates on the first character of each variable
name, i.e. M will only be changed to MOLE if it's the first
3 matches
Mail list logo