| ranks | R Documentation |
This function is superseded by the more versatile
transform.scdf function.
ranks(data, var, grand = TRUE, ...)
data |
A single-case data frame. See |
var |
A string or string vector with the names of the variables to be ranked. |
grand |
If TRUE, ranks will be calculated across all cases. If FALSE ranks are calculated within each case. |
... |
Additional parameters passed to the |
An scdf object where the values of the variable(s) are
replaced with ranks.
Juergen Wilbert
Other data manipulation functions:
add_l2(),
as.data.frame.scdf(),
as_scdf(),
fill_missing(),
moving_median(),
print.sc_outlier(),
rescale(),
scdf(),
select_cases(),
set_vars(),
shift(),
smooth_cases(),
standardize(),
truncate_phase()
# The ranks function is deprecated. Please use transform:
res1 <- ranks(Huber2014, var = "compliance")
res2 <- transform(Huber2014, across_cases(compliance = rank(compliance, na.last="keep")))
identical(res1, res2)
res1 <- ranks(Huber2014, var = "compliance", grand = FALSE)
res2 <- transform(Huber2014, compliance = rank(compliance, na.last="keep"))
identical(res1, res2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.