sort.lcens | R Documentation |
Sorts a vector into ascending or descending order: methods for "lcens" and "mcens" data. This function sorts left-censored values immediately below the equivalent uncensored values and right-censored values immediately above the equivalent uncensored values.
## S3 method for class 'lcens' sort(x, decreasing = FALSE, na.last = NA, ...) ## S3 method for class 'mcens' sort(x, decreasing = FALSE, na.last = TRUE, ...)
x |
the data to be sorted. |
decreasing |
sort the data in descending order? |
na.last |
for controlling the treatment of |
... |
arguments to be passed to or from methods. |
An object like x
, but with the data sorted. Left-censored
values are placed between smaller numeric values and the corresponding
uncensored values.
set.seed(5422) XR <- rnorm(10) sort(as.lcens(XR, rep(c(0, -1), each=5))) # censors at 0 and -1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.