Re: [R] Splitting a string expression into components

2013-07-08 Thread Yuliya Matveyeva
strsplit(x, split= " ") 2013/7/3 Dan Murphy > I have a vector of strings that contain mathematical expressions. E.g., > x <- c("5 <= 7", "z = 1+2") > and I would like to decompose each expression into its left- and > right-hand-side components etc., output something like > > "5" "<=" "7" > "z"

Re: [R] Splitting a string expression into components

2013-07-03 Thread Bert Gunter
ditto for the 2nd argument above > [[1]] > `+` > > [[2]] > [1] 1 > > [[3]] > [1] 2 > > Bill Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > > >> -Original Message----- >> From: r-help-boun...@r-project.org [mailto:r-help-

Re: [R] Splitting a string expression into components

2013-07-03 Thread William Dunlap
ilto:r-help-boun...@r-project.org] On > Behalf > Of Dan Murphy > Sent: Wednesday, July 03, 2013 10:38 AM > To: R-help@r-project.org > Subject: [R] Splitting a string expression into components > > I have a vector of strings that contain mathematical expressions. E.g., > x <-

[R] Splitting a string expression into components

2013-07-03 Thread Dan Murphy
I have a vector of strings that contain mathematical expressions. E.g., x <- c("5 <= 7", "z = 1+2") and I would like to decompose each expression into its left- and right-hand-side components etc., output something like "5" "<=" "7" "z" "=" "1" "+" "2" Is there something built into the R language