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 __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Guoqiang Wang <guo52717 at yahoo.com> writes:> 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?You just can't do that... If SQL allows newlines in expressions, you could do h3 <- sqlQuery(myConnect, "select * from console where \ byday = 'dd1' group by hour") (Since> x <- "a\+ n"> x[1] "a\nn" ) Otherwise you need an explicit paste(), as in querystr <- paste("select * from console where", "byday = 'dd1' group by hour") h3 <- sqlQuery(myConnect, querystr) -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Sat, 14 Jul 2001 11:08:48 -0700 (PDT), you wrote:>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.There are two ways. End each line with a backslash, i.e. s <- 'Start of long string\ second line of long string' This puts a \n in the string. I don't know if there's a way to avoid that on input, but you case use paste: s <- paste('Start of long string', 'second part of long string') Duncan Murdoch -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Guoqiang Wang wrote:> > 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?Don't use more than one line for each (quoted) string. The following lines should work: h3 <- sqlQuery(myConnect, "select * from console where yday = 'dd1' group by by hour") Uwe Ligges -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
----- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
----- 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 >Sorry. I was mistaken about the continuation character in the last message. The "+" merely shows up to indicate the continuation of the line. You could paste to together the pieces of the query this way (no "+" at the end of the line).> h3 <- sqlQuery(myConnect, paste("select * from console where",+ "foo > 20 order by foobar")) Perhaps someone will have a better suggestion. -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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
I'm a bit embarrassed to ask this, but can anyone tell me (or point me to a reference) on how to plot a regression plane in R? I have a regression model with two independent variables and have created a nice 3d scatterplot with scatterplot3d (thanks Uwe!) and now would like to overlay the regression plane (gridded, preferably.) Ay pointers would be appreciated. cheers, John -- John Williams Department of Marketing Otago University Dunedin, New Zealand -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._