Identification of the kth highest/lowest value(s).
kth(
x = NULL,
k = 2,
highest = TRUE,
index = FALSE,
unique = FALSE,
multiple = FALSE
)
If index = FALSE: the kth highest/lowest value is returned.
If index = TRUE: the index of the kth highest/lowest value (s) is/are returned.
Numeric vector.
Positive integer. The order of the value to find. Default = 2, which means that the next highest/lowest values is identified.
Logical. TRUE means that the kth highest value(s) is/are identified. FALSE means that the kth lowest value(s) is/are identified. Default = TRUE.
Logical. TRUE means that the index/indices of the kth highest/lowest value(s) is/are returned. FALSE means that the kth highest/lowest value itself is returned. If ties exist and argument multiple = TRUE, the returned value is a vector, else it is a value. Default = FALSE.
Logical. TRUE means that duplicates are removed before the identification of the kth highest/lowest value(s). Default=FALSE
Logical. TRUE means that, If ties exist a vector of all values in x that are equal to the kth highest/lowest values is returned. FALSE means that one random value from the vector of index values is returned. Default=FALSE
NA values are removed.
kth(x=1:20, k=3, highest=FALSE)
Run the code above in your browser using DataLab