[R] How to remove the double or single quote from a string (unquote?)?

From: JingJiang Yan <jingjiangyan_at_gmail.com>
Date: Tue, 19 Apr 2011 00:38:01 +0800

Is there a function to get a string without a pair of quotes around it?

I have several expressions like:
glm(V12 ~ V3, family=binomial, data=df1) glm(V12 ~ V4, family=binomial, data=df1) ...
glm(V12 ~ V8, family=binomial, data=df1)

As you can see, the only differences among them are V3 ... V8. Because sometimes several of these expressions are performed many times, I want to use a variable "i" to change the V3 ... V8. I did this with:

> i <- 3:8
> glm(V12 ~ paste("V", i, sep=""), family=binomial, data=df1)

However, it seems the paste always returns a variable name with a pair of quotes, which were wrong in such condition. I only find a function "sQuote" to add quotes to a string, and it looks I am looking for an opposite function of it. Any advice will be appreciated.

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. Received on Mon 18 Apr 2011 - 16:41:36 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 18 Apr 2011 - 17:10:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive