[R] single, double or no quotes in expression
dwinsemius at comcast.net
Thu Mar 15 16:53:30 CET 2012
On Mar 15, 2012, at 10:55 AM, capy_bara wrote:
> Dear all,
> I am confused about how to create an expression. I use a package
> which uses expressions and seems to make a difference if there is a
> around the expression or not.
> For example, package works with expressions such as
>> expression(A + B)
> but not with
>> expression("A + B")
> I now have a set of math expressions represented as strings,
> something like
>> rhs_eq<- c("0", "A + B", "B * (2+C)")
> and want to make expressions without quotes out of it.
> I tried
>> lapply(lapply(rhs_eq, as.symbol), as.expression)
> which only turns the double quotes into single quotes, but does not
> the quotes.
> I also played around with as.formula, as.name, quote and enquote,
> but had no
> Does anyone know about quotes in the expression data type?
expression(0, A + B, B * (2+C))
expression(A + B)
expression(B * (2+C))
> Thanks in advance,
> View this message in context: http://r.789695.n4.nabble.com/single-double-or-no-quotes-in-expression-tp4475247p4475247.html
> Sent from the R help mailing list archive at Nabble.com.
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
David Winsemius, MD
West Hartford, CT
More information about the R-help