From 887b45cf323e9a542992aab466d110c45adbb452 Mon Sep 17 00:00:00 2001 From: mhahsler Date: Sun, 13 Dec 2015 21:23:46 -0600 Subject: [PATCH] small fixes. --- DESCRIPTION | 4 ++-- NAMESPACE | 3 ++- R/is.significant.R | 19 ++++++++----------- inst/NEWS | 9 ++++----- man/affinity.Rd | 2 +- man/random.transactions.Rd | 4 ++-- 6 files changed, 19 insertions(+), 22 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index d8baa72..14bee60 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: arules -Version: 1.3-0.1 -Date: 2015-xx-xx +Version: 1.3-1 +Date: 2015-12-13 Title: Mining Association Rules and Frequent Itemsets Authors@R: c(person("Michael", "Hahsler", role = c("aut", "cre", "cph"), email = "mhahsler@lyle.smu.edu"), diff --git a/NAMESPACE b/NAMESPACE index e96571d..d508e0a 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -16,7 +16,8 @@ useDynLib(arules, ) import("methods") -importFrom("stats", "predict", "aggregate", "as.dist", "cor", "rpois") ## we want to add methods +importFrom("stats", "predict", "aggregate", "as.dist", "cor", + "rpois", "p.adjust") ## we want to add methods importFrom("utils", "head", "write.table") ## we want to add methods import("graphics") diff --git a/R/is.significant.R b/R/is.significant.R index 77ee1e9..0439c84 100644 --- a/R/is.significant.R +++ b/R/is.significant.R @@ -18,17 +18,14 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - ## uses fishers exact test to find significant rules (corrected) - - setMethod("is.significant", signature(x = "rules"), - function(x, transactions, alpha = 0.01, adjust = "bonferroni") { - p <- quality(x)[["fishersExactTest"]] - if(is.null(p)) p <- interestMeasure(rules, - measure = "fishersExactTest", - transactions = transactions) - if(adjust != "none") p <- p.adjust(p, method = adjust) - p <= alpha - }) + function(x, transactions, alpha = 0.01, adjust = "bonferroni") { + p <- quality(x)[["fishersExactTest"]] + if(is.null(p)) p <- interestMeasure(x, + measure = "fishersExactTest", + transactions = transactions) + if(adjust != "none") p <- p.adjust(p, method = adjust) + p <= alpha + }) diff --git a/inst/NEWS b/inst/NEWS index 7b04c34..a538b49 100644 --- a/inst/NEWS +++ b/inst/NEWS @@ -1,11 +1,10 @@ -Changes in version 1-3-0.1 (xx/xx/2015) +Changes in version 1-3-1 (12/13/2015) * we now require R 2.3.0 so cbind in Matrix works. * is.maximal is now also available for rules. - * added is.significant for rules (used Fishers exact test). + * added is.significant for rules (uses Fishers exact test with correction). * added is.redundant for rules. - * added support for multi-level analysis. - * APparameter: confidence shows not NA for frequent itemsets. - + * added support for multi-level analysis (aggregate). + * APparameter: confidence shows now NA for frequent itemsets. Changes in version 1-3-0 (11/11/2015) * removed deprecated WRITE and SORT functions. diff --git a/man/affinity.Rd b/man/affinity.Rd index ebaff70..2d2dd1b 100644 --- a/man/affinity.Rd +++ b/man/affinity.Rd @@ -42,7 +42,7 @@ s <- sample(Adult, 500) s a <- affinity(s) -summary(as.vector(a)) +image(a) } \references{ Charu C. Aggarwal, Cecilia Procopiuc, and Philip S. Yu (2002) diff --git a/man/random.transactions.Rd b/man/random.transactions.Rd index 4eb1609..6e8a99a 100644 --- a/man/random.transactions.Rd +++ b/man/random.transactions.Rd @@ -114,11 +114,11 @@ image(trans) ## use the method by Agrawal and Srikant (1994) to simulate transactions ## which contains correlated items. This should create data similar to -## T10I4D100K (just only 1000 transactions) +## T10I4D100K (we just create 100 transactions here to speed things up). patterns <- random.patterns(nItems = 1000) summary(patterns) -trans2 <- random.transactions(nItems = 1000, nTrans = 1000, +trans2 <- random.transactions(nItems = 1000, nTrans = 100, method = "agrawal", patterns = patterns) image(trans2)