[R] How to quit R script & return to R prompt

S Ellison S.Ellison at LGCGroup.com
Thu Oct 25 15:00:01 CEST 2012


> You typed a ` without closing it:
> barplot(xtab(`profits`,data=Forbes2000)) 
> anyway: pushing the escape button should also return you to 
> the R-prompt (at least on a Windows platform)

But why is the OP using a backtick at all? It's not necessary in this instance (and in fact it's very rarely necessary at all unless you have used a syntactically invalid name with something silly like spaces in it). See ?Quotes for a little more detail on what ` does.

Also, xtab should possibly be xtabs, and the first argument to that is a one-sided formula, not a vector:

> library(HSAUR)
> barplot(xtabs( ~ profits,data=Forbes2000)) 

should work fine.

This email and any attachments are confidential. Any use...{{dropped:8}}

More information about the R-help mailing list