[R] "Negative length vectors are not allowed" error

Kim C. minorthreatx at hotmail.com
Tue Jan 20 11:27:44 CET 2015


<br>If the email is still unreadable, please look at the attachment email.txt. <br>Dear Martin,<br><br>Thanks for your fast reply. Sorry about the formatting of the previous email. I actually tested it before sending and it came fine when sending to my own account but when I send it to the r-help email address it seemed like the formatting got lost. <br><br>I can actually send you the project of R I am working in because for this experiment I am only using the Contoso DWH testdata from Microsoft. <br>The R project is too big to include in the attachment, so you can download it from my dropbox via this link: <br><a href="https://www.dropbox.com/s/lry1v7ka2env5xf/Example.RData?dl=0" target="_blank">https://www.dropbox.com/s/lry1v7ka2env5xf/Example.RData?dl=0</a><br><br>I see I a made a small mistake in my description, so I will rewrite it shortly in steps: <br>1. ruleset <- apriori(sales, parameter=list(support=0.0005, confidence=0.1, minlen=2)) This gives 780379 rules. <br>2. inspect(subset(ruleset, subset=rhs %pin% "Product="))<br>3. just inspect(ruleset) does work. When finishing displaying  the 780379 rules, it also show me this and this message: <br>Warning message:<br>closing unused RODBC handle 1 <br><br>If I understand the last part correctly, I should add Michael Hahsler's email address to the BCC. Otherwise, my apologies. <br><br>Thanks again, <br><br>Kim <br>----------------------------------------<br>> From: maechler at stat.math.ethz.ch<br>> Date: Tue, 20 Jan 2015 10:30:34 +0100<br>> To: minorthreatx at hotmail.com<br>> CC: r-help at r-project.org; maechler at stat.math.ethz.ch<br>> Subject: Re: [R] "Negative length vectors are not allowed" error<br>><br>><br>> > Hi all, I have a question concerning an error that occurs when using the inspect() function on a set of rules made by the apriori function from the arules package. I have a dataset with 12 million records. It contains some basic sales information (such as product, customer data). I want to use the apriori function from the arules package on it: ruleset <- apriori(sales, parameter=list(support=0.0005, confidence=0.1, minlen=2))It gives me 780379 rules. I want to have that much rules on purpose, so hence the parameters being so low (I guess you can reproduce this problem with any large dataset and low settings for support and confidence). But then I want to check out the rules with inspect. It has a subset because I'm only interested in rules with the attribute Product in the rhs. inspect(subset(ruleset, subset=rhs %pin% "Product="))Then this error occurs: Error in inspect(subset(sales3ruleset, subset = rhs %pin% "Product=")) :<br>> > error in evaluating the argument 'x' in selecting a method for function 'inspect': Error in .Call("R_or_ngCMatrix", x at data, y at data, PACKAGE = "arules") :<br>> > negative length vectors are not allowedI looked around and apparently that part about "negative length vectors are not allowed" means that you want to create a vector that is larger than 2^31. How can you get around this limit? Or how can I make the inspectfunction work in this case?Thanks in advance!Kim<br>> Dear Kim,<br>><br>> if you learned to post (i.e. write that e-mail) in plain text,<br>> the above would look more humane..<br>><br>> Still, I was able to decipher it and you are right in that<br>> you hit a limitation of the current setup which may well<br>> be linked to the Matrix package which I maintain, and on which<br>> 'arules' depends.<br>><br>> Can you please try to find a reproducible example [with randomly<br>> generated data; i.e., you'd use set.seed(), runif(), rpois(),<br>> rmultinom(), rnorm(), ...] so we,<br>> the maintainer of 'arules' Michael Hahsler (BCC'ed: use<br>> maintainer("arules") to find such an e-mail address),<br>> and myself can look if and how that limitation might be lifted.<br>><br>> Best regards,<br>> Martin Maechler, ETH Zurich<br> 		 	   		  
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: email.txt
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20150120/ac8de703/attachment.txt>


More information about the R-help mailing list