1
0
Fork 0
mirror of https://github.com/prise6/aVirtualTwins.git synced 2024-05-23 23:02:12 +02:00

Fix some bug and documentation

This commit is contained in:
prise6 2015-07-31 17:21:28 +02:00
parent 241e4cf467
commit 31e16ab68d
2 changed files with 16 additions and 14 deletions

View file

@ -12,6 +12,8 @@
#' @param tables set to TRUE if tables of incidence must be shown. FALSE is #' @param tables set to TRUE if tables of incidence must be shown. FALSE is
#' default. #' default.
#' @param verbose print infos during computation. FALSE is default. #' @param verbose print infos during computation. FALSE is default.
#' @param compete print competitors rules thanks to competitors computation of
#' the tree
#' #'
#' @return data.frame of rules #' @return data.frame of rules
#' #'
@ -37,11 +39,11 @@
vt.subgroups <- function(vt.trees, only.leaf = T, only.fav = T, tables = F, verbose = F){ vt.subgroups <- function(vt.trees, only.leaf = T, only.fav = T, tables = F, verbose = F){
if(is.list(vt.trees)){ if(is.list(vt.trees)){
subgroups <- lapply(vt.trees, function(x)x$getRules(only.leaf = only.leaf, only.fav = only.fav, tables = tables, verbose = verbose)) subgroups <- lapply(vt.trees, function(x)x$getRules(only.leaf = only.leaf, only.fav = only.fav, tables = tables, verbose = verbose, compete = F))
unique(do.call(rbind, subgroups)) unique(do.call(rbind, subgroups))
} }
else{ else{
subgroups <- vt.tree$getRules(only.leaf = only.leaf, only.fav = only.fav, tables = tables, verbose = verbose) subgroups <- vt.tree$getRules(only.leaf = only.leaf, only.fav = only.fav, tables = tables, verbose = verbose, compete = compete)
} }
} }

View file

@ -168,7 +168,7 @@ VT.tree <- setRefClass(
warning("VT.tree : no rules"); return(invisible(NULL)); warning("VT.tree : no rules"); return(invisible(NULL));
} }
pth <- path.rpart(.self$tree, nodes = row.names(frm), print.it = F) pth <- rpart::path.rpart(.self$tree, nodes = row.names(frm), print.it = F)
# Delete 'root' node des règles # Delete 'root' node des règles
pth <- lapply(pth, FUN = function(d) return(d[-1])) pth <- lapply(pth, FUN = function(d) return(d[-1]))