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) : :1:16: unexpected input 1: response ~ P/E+

Re: [R] Dealing with parentheses within variable names

2013-03-01 Thread Duncan Murdoch
e, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf > Of Duncan Murdoch > Sent: Thursday, February 28, 2013 1:46 PM > To: Jesus Munoz Serrano > Cc: r-help@r-project.org > Subjec

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 : > Try > > sub("[(]","", names(dataFrams) > > and > > sub("[)]","", names(dataFrams) > > Frans > > > > > 2013/2/28 Jesus Munoz Serrano >> >> Dear all >> >> I'm having some prob

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 > > 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 William Dunlap
roject.org] 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: > > D

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 l

Re: [R] Dealing with parentheses within variable names

2013-02-28 Thread arun
\(\\)","",names(datF)) #[1] "fBodyGyroskewnessZ" A.K. - Original Message - From: Bert Gunter To: Jesus Munoz Serrano 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 t

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 wrote: > Please read ?regex, where it says: > > " Any metacharacter with special meaning may be quoted by preceding it > with a backslash. Th

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))

[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 it