rankdf: Ranks in a data.frame

Description Usage Arguments Value Examples

View source: R/Helpers.R

Description

Ranks in a data.frame

Usage

1
rankdf(df, increasing = NULL, decreasing = NULL, ...)

Arguments

df

A data frame.

increasing

A character vector of column names of the data frame to be ranked in increasing order.

decreasing

A character vector of column names of the data frame to be ranked in decreasing order.

...

Additional arguments to be passed on to rank().

Value

A data frame with the ranks computed in the columns specified in arguments increasing and decreasing.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(agricolae)
data(soil)

dec <- c("pH", "EC")
inc <- c("CaCO3", "MO", "CIC", "P", "K", "sand",
         "slime", "clay", "Ca", "Mg", "K2", "Na", "Al_H", "K_Mg", "Ca_Mg",
         "B", "Cu", "Fe", "Mn", "Zn")

soilrank <- rankdf(soil, increasing = inc, decreasing = dec)
soilrank

ajaygpb/AMMIStbp documentation built on Jan. 27, 2020, 8:53 a.m.