Description Usage Arguments Value See Also Examples
View source: R/complex_functions.R
In this wrapper function for the known cut
function, the
breaks
vector need not be supplied directly, instead, for every
break, an interval is supplied and the function optimizes the choice of
the breakpoint by chosing a local minimum of the distribution.
1 2 3 |
in_vector |
Vector of numerical continuously distributed input |
in_outlier_cutoffs |
Interval specifyinf the upper and lower bounds of the range to be considered |
in_cutoff_ranges_list |
List if intervals in which the cutoffs for |
in_labels |
Labels assigned to the strata or factors returned |
in_name |
String specifying the name of the quantity analyzed (and plotted on the x-axis of the figure to be created). |
output_path |
Path where the figure produced by the density function should be stored if non-NULL. |
A list with entries
category_vector
, and
density_plot
and
cutoffs
category_vector
:
Factor vector of the categories or strata, of the same length as
in_vector
density_plot
:
Density plot produced by the density function and indication of the
chosen cutoffs.
cutoffs
:
Vector of the computed optimal cutoffs
1 2 3 4 5 6 7 8 | data(lymphoma_test)
lymphoma_test_df$random_norm <- rnorm(dim(lymphoma_test_df)[1])
temp_list <- cut_breaks_as_intervals(
lymphoma_test_df$random_norm,
in_outlier_cutoffs=c(-4,4),
in_cutoff_ranges_list=list(c(-2.5,-1.5),c(0.5,1.5)),
in_labels=c("small","intermediate","big"))
temp_list$density_plot
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.