[R] Multi-line paste function

Lapointe, Pierre Pierre.Lapointe at nbf.ca
Tue Mar 14 20:32:36 CET 2006


Hello Phillipe

1-You are right that for a simple example as the one I provided, paste and
gsub give the same result.
2-For a more complex case, where let's say, I'd like to include a variable
in my SQL statement, the multi.line.paste command is essential.

variable <-1.9
multi.line.paste("
SELECT * 
FROM estimates3 a, newtable b 
WHERE a.Ticker=b.Ticker 
AND a.Fiscal_Year=b.Fiscal_Year
AND a.EPS<>b.EPS 
AND a.Date_Last_change_or_conf-",variable,">b.Date_Last_change_or_conf
",sep="")

Regards,

Pierre 

**************************************************
AVIS DE NON-RESPONSABILITE: Ce document transmis par courrie...{{dropped}}




More information about the R-help mailing list