Commit de1d29eb authored by Holger Brandl's avatar Holger Brandl

added is_distinct

parent f7cd9b7c
......@@ -196,6 +196,7 @@ push_left <- function(df, pushColNames){
#http://astrostatistics.psu.edu/datasets/R/html/base/html/formals.html
## todo does this clash with purrr::set_names
set_names <- function(df, ...){
#browser()
newnames <- as.character(unlist(list(...)))
......@@ -363,6 +364,12 @@ count_as= function(df, n_name, ...) count(df, ...) %>% n_as(n_name)
distinct_all = function (x, ...) distinct(x, ..., .keep_all=T)
#' Return <code>true</code> if the data.frame is distinct with respect to the provided unqoted variabled names/expressions
is_distinct = function(x, ...){
distinct(x) %>% nrow == nrow(x)
}
## fetch a column of a matrix in a magrittr pipe. Useful along with str_*
get_col = function(data, col_index) data[, col_index] ## also could use magrittr::extract here
......
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