Skip to content

Error in Arules

4 messages · Tibert, Brock, Duncan Murdoch

#
On 04/03/2008 4:34 PM, Tibert, Brock wrote:
It would be helpful to show code that works, and code that doesn't.  But 
what the error message says is that someone (you?  the code you called?) 
called the image.default function with just one argument basket2, and 
it's not a matrix.

Duncan Murdoch
#
Thanks for getting back to me.

Here are the basic commands:

These commands work:
library("arules")
basket <- read.csv("C:/Documents and Settings/     /Desktop/mba2.csv",
na.strings=c(".", "NA", "", "?"))
basket2 <- as(split(basket$Product, basket$Id), "transactions")

the following command used to work.  It stopped when I tried to edit the
axes.
image(basket2)

Here is the error:
Error in image.default(basket2) : 'z' must be a matrix

As an aside, when I start R, I noticed that this shows up, and I do not
remember if this was normal:

*******
Loading required package: utils
Loading required package: stats
Loading required package: lattice

Attaching package: 'Matrix'


        The following object(s) are masked from package:stats :

         xtabs 

** fixing ngCMatrix validation
[Previously saved workspace restored]
********


Thanks again,

Brock

-----Original Message-----
From: Duncan Murdoch [mailto:murdoch at stats.uwo.ca] 
Sent: Tuesday, March 04, 2008 4:51 PM
To: Tibert, Brock
Cc: r-help at r-project.org
Subject: Re: [R] Error in Arules
On 04/03/2008 4:34 PM, Tibert, Brock wrote:
R.
It would be helpful to show code that works, and code that doesn't.  But

what the error message says is that someone (you?  the code you called?)

called the image.default function with just one argument basket2, and 
it's not a matrix.

Duncan Murdoch
#
On 3/4/2008 5:14 PM, Tibert, Brock wrote:
basket2 is not a matrix.  I think the business about the axes is a 
coincidence:  probably the previous times when you tried this, basket2 
*was* a matrix.
Some people disagree, but in my opinion, it's always a bad idea to save 
your workspace, so that R restores old one when you restart.  You never 
know what is in there causing trouble.

My advice would be to always choose "No" when asked whether to save the 
workspace as you shut down.  Then, while R is shut down, find the .RData 
file (probably in your home directory) and delete it.  Be aware that 
this will lose all R objects in it, so don't do it unless you know how 
to rebuild them.

Duncan Murdoch