Skip to content
Back to formatted view

Raw Message

Message-ID: <CAFFQM6aUeJ=Poz0QnnW37HpKrKbA4BwMJOeHMuXC655Oz8dWhg@mail.gmail.com>
Date: 2013-03-01T16:47:33Z
From: Frans Marcelissen
Subject: Dealing with parentheses within variable names
In-Reply-To: <CAFFQM6Y9Dn1AOa0frcWQwwzZLQr0JF+s6OnP=VM4pVNHaGRX6Q@mail.gmail.com>

Sorry:
> sub("[(]","", names(dataFrame)
>
> and
>
> sub("[)]","", names(dataFrame)
>
> Frans

2013/3/1 Frans Marcelissen <fransiepansiekevertje at gmail.com>:
> Try
>
> sub("[(]","", names(dataFrams)
>
> and
>
> sub("[)]","", names(dataFrams)
>
> Frans
>
>
>
>
> 2013/2/28 Jesus Munoz Serrano <jesusmunozserrano at gmail.com>
>>
>> Dear all
>>
>> I'm having some problems with a data set that has parenthesis within the variable names. A example of this kind of variable names is the following:
>>
>>                                 fBodyGyroskewness()Z
>>
>> The case is that R is having a lot of troubles to identify the variable (probably it does understand it like a function). I've tried (among other things) to remove the parenthesis from the name using the following command:
>>
>>                                 names(dataFrame) <- sub("()","", names(dataFrame))
>>
>> but It didn't work.  Sorry if it's a silly issue but I would really appreciate if anybody could help me. Thank you very much.
>>         [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help at 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.