fx.get_circle_df: Make a data.frame for encircling points in a reduced...

Description Usage Arguments Details Value See Also

View source: R/plot_drp.R

Description

For the encircling, we will use the values of X and Y to determine the coordinates for the circle that will either capture all values, or those within the quantile defined by which_quant. Multiple circles may be drawn based on groups provided via separate_by.

Usage

1
2
fx.get_circle_df(in.df, X = "x_axs", Y = "y_axs", separate_by = NULL,
  keep_quant = 1)

Arguments

in.df

data.frame that is used for making the original plot.

X

name (or integer index) of the column of in.df that contains the values to be used for determining the x axis coordinates (default: "x_axs").

Y

name (or integer index) of the column that contains the values to be used for determining the y axis coordinates (default: "y_axs".,

separate_by

factor that will be used to split the values of X and Y into distinct groups (e.g., by "condition"); if NULL (default), which_quant

keep_quant

a number between 0.5 and 1 to define the max. quantile for any value of X or Y that will be kept for defining the circle coordinates. The default is to capture all points that belong to one instance of separate_by, i.e. keep_quant= 1. It might be useful to set it to less than 1 (e.g., 0.99) if you don't want the circle to be blown up by individual outliers. 0.99 would ensure that only those points between the 99th percentile and the 0.01st percentile (1 - 0.99) would be kept.

Details

Sometimes, it is useful to remove outlier coordinates before drawing the circles. If keep_quant= 1, the output will be exactly the content of in.df. keep_quant should be a number between 1 and 0.5, usually you will want to use something between 0.95 and 1.

Integer indeces for X and Y must be given in proper integer notation (e.g., 1L) so that is.integer(X) passes.

Value

data.table, most likely a subset of the in.df, depending on the setting of which_quant. This data.table can be used with ggalt::geom_encircle.

See Also

plot_reduced_dim.df, scABC2::generate.DimRedPlot


evanbiederstedt/sandbox documentation built on May 26, 2019, 12:31 p.m.