[R] how to type long string

Bill Oliver wloliver at qwest.net
Sat Jul 14 22:41:36 CEST 2001


----- Original Message -----
From: "Guoqiang Wang" <guo52717 at yahoo.com>
To: <r-help at lists.R-project.org>
Sent: Saturday, July 14, 2001 12:08 PM
Subject: [R] how to type long string


> Hi, All:
>
> I try to type some long string in R console, whenever
> I like to change to a new line, I get error message.
>
> The following is my simple code
> --------------------------------------
> h3 <- sqlQuery(myConnect, "select * from console where
>
> Error: syntax error
> byday = 'dd1'group by by hour")
> Error: syntax error
>
> ---------------------------------------
>
> Any Hints?
>
> Thanks.
>
> Grant, UWO
>

Normally, one can use "+" as a continuation character. Because you are in
the midst of typing a string the continuation character won't work in this
instance. You could perhaps use "paste" to join together the pieces of the
query. For example-

> h3 <- sqlQuery(myConnect, paste("select * from console where", +
+ "foo > 20 order by foobar"))

-Bill



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list