Re: [R] Dealing with parentheses within variable names

2013-03-02 Thread Duncan Murdoch
On 13-03-01 12:57 PM, Duncan Murdoch wrote: On 01/03/2013 11:20 AM, William Dunlap wrote: A core R function that fails with odd names is reformulate(): reformulate(c(P/E, % Growth), response=+-) Error in parse(text = termtext) : text:1:16: unexpected input 1: response ~ P/E+%

Re: [R] Dealing with parentheses within variable names

2013-03-01 Thread William Dunlap
] Dealing with parentheses within variable names On 28/02/2013 11:08 AM, Jesus Munoz Serrano wrote: 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

Re: [R] Dealing with parentheses within variable names

2013-03-01 Thread Frans Marcelissen
Try sub([(],, names(dataFrams) and sub([)],, names(dataFrams) Frans 2013/2/28 Jesus Munoz Serrano jesusmunozserr...@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:

Re: [R] Dealing with parentheses within variable names

2013-03-01 Thread Frans Marcelissen
Sorry: sub([(],, names(dataFrame) and sub([)],, names(dataFrame) Frans 2013/3/1 Frans Marcelissen fransiepansiekever...@gmail.com: Try sub([(],, names(dataFrams) and sub([)],, names(dataFrams) Frans 2013/2/28 Jesus Munoz Serrano jesusmunozserr...@gmail.com Dear all I'm

Re: [R] Dealing with parentheses within variable names

2013-03-01 Thread Duncan Murdoch
] On Behalf Of Duncan Murdoch Sent: Thursday, February 28, 2013 1:46 PM To: Jesus Munoz Serrano Cc: r-help@r-project.org Subject: Re: [R] Dealing with parentheses within variable names On 28/02/2013 11:08 AM, Jesus Munoz Serrano wrote: Dear all I'm having some problems with a data set that has

[R] Dealing with parentheses within variable names

2013-02-28 Thread Jesus Munoz Serrano
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

Re: [R] Dealing with parentheses within variable names

2013-02-28 Thread Bert Gunter
Please read ?regex, where it says: Any metacharacter with special meaning may be quoted by preceding it with a backslash. The metacharacters in EREs are . \ | ( ) [ { ^ $ * + ?, but note that whether these have a special meaning depends on the context. So use: sub(\(\),, names(dataFrame))

Re: [R] Dealing with parentheses within variable names

2013-02-28 Thread Bert Gunter
Oops -- forgot that you have to double the backslashes: So use: sub(\\(\\),, names(dataFrame)) -- Bert On Thu, Feb 28, 2013 at 1:20 PM, Bert Gunter bgun...@gene.com wrote: Please read ?regex, where it says: Any metacharacter with special meaning may be quoted by preceding it with a

Re: [R] Dealing with parentheses within variable names

2013-02-28 Thread arun
Gunter gunter.ber...@gene.com To: Jesus Munoz Serrano jesusmunozserr...@gmail.com Cc: r-help@r-project.org Sent: Thursday, February 28, 2013 4:25 PM Subject: Re: [R] Dealing with parentheses within variable names Oops -- forgot that you have to double the backslashes: So use: sub(\\(\\),, names

Re: [R] Dealing with parentheses within variable names

2013-02-28 Thread Duncan Murdoch
On 28/02/2013 11:08 AM, Jesus Munoz Serrano wrote: 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