Commit d87ba8dd authored by Holger Brandl's avatar Holger Brandl

added filter_count

parent 3e10529f
......@@ -254,8 +254,9 @@ replaceNA <- function(x, withValue) { x[is.na(x)] <- withValue; x }
## todo still needed
## todo still needed since there's if_else in dplyr now
safe_ifelse <- function(cond, yes, no) {
#browser()
isfacOrChar <- function(x) class(x) %in% c("factor", "character")
......@@ -300,6 +301,13 @@ empty_as_na <- function(x){
## see http://stackoverflow.com/questions/24172111/change-the-blank-cells-to-na/33952598#33952598
## apply dplyr::filter to df but use filter criterions for cross-tabulation beforehand
filter_count <- function(df, ...){
print(count(df, ...))
filter(df, ...)
}
reload_dplyr <- function(){
unloadNamespace('tidyr')
unloadNamespace('dplyr')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment