Print the below string using R

sqldf
r
sql
query

#1

Hi,

I need to print the below string: How can I do that using R?
I should assign the below query to a variable and print the variable.

"SELECT
t2.delfn as Derate,
t2.zt1a as T_ambient,
t4.great_circle_distance/420*3600 as Flight_Duration_from_GCD,
t3.“1999+2014 PM10 Hybrid Data (ug/m3)” as PM10_Hybrid,
t3.“2006 GoCart Sulfates” as Sulphates,

From
FROM rdf_published.cfm56_phm_flight t1

WHERE
t1.src_icao_cd in (‘SVA’)
and t1.engine_type like ‘%5B%’ "


#2

You need to escape the double quotes that get repeated again.
var <- "SELECT
+ t2.delfn as Derate,
+ t2.zt1a as T_ambient,
+ t4.great_circle_distance/4203600 as Flight_Duration_from_GCD,
+ t3.“1999+2014 PM10 Hybrid Data (ug/m3)” as PM10_Hybrid,
+ t3.“2006 GoCart Sulfates” as Sulphates,
+
+ From
+ FROM rdf_published.cfm56_phm_flight t1
+
+ WHERE
+ t1.src_icao_cd in (‘SVA’)
+ and t1.engine_type like ‘%5B%’ "
var
[1] "SELECT \nt2.delfn as Derate,\nt2.zt1a as T_ambient,\nt4.great_circle_distance/420
3600 as Flight_Duration_from_GCD,\nt3.“1999+2014 PM10 Hybrid Data (ug/m3)” as PM10_Hybrid,\nt3.“2006 GoCart Sulfates” as Sulphates,\n\nFrom \nFROM rdf_published.cfm56_phm_flight t1\n\nWHERE\nt1.src_icao_cd in (‘SVA’) \nand t1.engine_type like ‘%5B%’ "


#3

Thank you very much. It worked