[R] Interaction plot type=o
petr.pikal at precheza.cz
Fri Sep 30 08:16:46 CEST 2011
> thank you for your reply
> I tried this
> interaction.plot(cyl, gear, mpg, type="o", pch=5:8, lty=1 )
> but I got this error:
> Error in match.arg(type) : 'arg' should be one of "l", "p", "b"
> and in ?interaction.plot, "o" it is not listed in type arguments.
> Is there any other way to force it to take the argument?
As David suggested you need to change code for interaction.plot. If you
you will get the code
function (x.factor, trace.factor, response, fun = mean, type = c("l",
"p", "b"), legend = TRUE, trace.label =
fixed = FALSE, xlab = deparse(substitute(x.factor)), ylab = ylabel,
ylim = range(cells, na.rm = TRUE), lty = nc:1, col = 1, pch = c(1L:9,
0, letters), xpd = NULL, leg.bg = par("bg"), leg.bty = "n",
xtick = FALSE, xaxt = par("xaxt"), axes = TRUE, ...)
Copy it into some suitable text editor (not Word please) and change it
according to your wish. I would start with adding "o" to type in function
definition and see how it behaves. Then you can copy the whole code to
your modified function e.g.
my.int.plot <- function(x,....
my.int.plot(cyl, gear, mpg, type="o", pch=5:8, lty=1 )
> On Thu, Sep 29, 2011 at 9:00 PM, David Winsemius
<dwinsemius at comcast.net>wrote:
> > On Sep 29, 2011, at 7:22 PM, Heverkuhn Heverkuhn wrote:
> > Hello,
> >> I was wondering if there is any equivalent of interaction.plot that
> >> you to set type="o"
> >> I tried to use interaction.plot and I have a gap between the symbols
> >> the
> >> points and the line.
> > If it's OK to have the lines going right though the symbols, then go
> > hack the code. All you need to do is add ,"o" to the type arguments in
> > argument list. The code's not hidden or anything that gets in your
> > David Winsemius, MD
> > West Hartford, CT
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help