[R] quotes within quotes

Roger Peng rpeng at stat.ucla.edu
Wed Apr 9 03:39:11 CEST 2003


You may want to investigate using do.call().  For example,

do.call("read.dta",list(convert.factors=FALSE, file="/full/path/name.dta"))

Or else, maybe a conbination of paste() and parse()/eval().

-roger
_______________________________
UCLA Department of Statistics
rpeng at stat.ucla.edu
http://www.stat.ucla.edu/~rpeng

On Tue, 8 Apr 2003, janet rosenbaum wrote:

> 
> How does one put quotes within quotes, if it's possible?  
> I've tried replacing one set of the quotes by single quotes.
> 
> If it's not possible, is there any way to do the following?
> 
>  > cmd <- "read.dta"
>  > opt <- "convert.factors=FALSE"
>  > data.file <- " file="/full/path/name.dta" "
>  > eval(call(cmd,data.file,opt))
> 
> Prior to adding this option, I had been using match.fun to get the 
> function call corresponding to cmd and then evaluating it, but match.fun 
> doesn't seem to help here.
> 
> Thanks,
> 
> Janet
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>



More information about the R-help mailing list