Re: [R] arules package: using image() deliveres unexpected results

From: Achim Zeileis <Achim.Zeileis_at_wu-wien.ac.at>
Date: Sat 29 Jul 2006 - 02:18:31 EST

Markus:

> it seems like there is a problem with the image()-method in the package
> arules.

For problems with packages, please contact the maintainer or at least have im Cc as the posting guide tells you.

> Using an ordninary matrix works fine:
> image(matrix(rnorm(200), 10, 20), axes = FALSE, col=brewer.pal(9, "Blues") )

Note that image() is a generic function, the methods called in your example above is rather different from the methods below.

> delivers an image with blue colors and no axes.
>
> Using an object of the class "associations" (arules package) does not work:
>
> image(items(ta.eclat), axes = FALSE, col=brewer.pal(9, "Blues") )
> delivers an error message telling that the argument "col" matches to
> several formal arguments.

So maybe you should check what arguments are allowed for the method in arules:
  help("image", package = "arules")
tells you to look that essentially levelplot() is called and   help("levelplot", package = "lattice") shows that there are two arguments starting with `col' (col.regions and colorkey) and that there is no argument `axes'.

> In the source code of arules I couldn't find any definition of the
> image-function (especially no image.R-file.)

It's in itemMatrix.R, because it is the image() method for "itemMatrix" objects. You can also see in

  getMethod("image", "itemMatrix")
that it calls the "dgTMatrix" method:
  getMethod("image", "dgTMatrix")

which calls levelplot().

A note to Michael (arules maintainer): the link from the image() documentation in arules to Matrix is broken (should be to "dgTMatrix-class") and maybe you should also link levelplot() in lattice explicitely?

hth,
Z



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat Jul 29 03:34:38 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 29 Jul 2006 - 04:17:08 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.