confirm data has good ranked groups
replyr_check_ranks( x, GroupColumnName, ValueColumnName, RankColumnName, ..., decreasing = FALSE, tempNameGenerator = mk_tmp_name_source("replyr_check_ranks") )
x | data item to work with |
---|---|
GroupColumnName | column to group by |
ValueColumnName | column determining order |
RankColumnName | column having proposed rank (function of order) |
... | force later arguments to bind by name |
decreasing | if true make order decreasing instead of increasing. |
tempNameGenerator | temp name generator produced by wrapr::mk_tmp_name_source, used to record dplyr::compute() effects. |
summary of quality of ranking.
d <- data.frame(Sepal_Length=c(5.8,5.7),Sepal_Width=c(4.0,4.4), Species='setosa',rank=c(1,2)) replyr_check_ranks(d,'Species','Sepal_Length','rank', decreasing=TRUE)#> goodRankedGroup groupID nRows nGroups nBadRanks nUniqueRanks nBadOrders #> 1 TRUE setosa 2 1 0 2 0