データ操作

funcSelectColName

funcSelectColName <- function(x, type){
  xx <- dplyr::select_if(x, is.numeric)
  switch(type, 
         "max" = apply(xx, 1, function(xx) names(xx)[which.max(xx)]), 
         "min" = apply(xx, 1, function(xx) names(xx)[which.min(xx)]))
}

ユーティリティ

funcCountLibFuncs

funcCountLibFuncs <- function(package, counts = TRUE, all.names = FALSE, pattern) 
{
  package <- deparse(substitute(package))
  funcs <- ls(
    pos = paste("package", package, sep = ":"), 
    all.names = all.names, 
    pattern = pattern
  )
  ifelse(counts == TRUE, length(funcs), print(funcs))
}
inserted by FC2 system