View source: R/bin_columns_into_quantiles.r
bin_columns_into_quantiles | R Documentation |
bin_columns_into_quantiles
bin_columns_into_quantiles
is an internal function used to convert a
vector of specificity into a vector of specificity quantiles.
This function can be iterated across a matrix using apply
to create a matrix of specificity quantiles.
bin_columns_into_quantiles(
vec,
numberOfBins = 40,
defaultBin = as.integer(numberOfBins/2)
)
vec |
The vector of gene of specificity values. |
numberOfBins |
Number of quantile bins to use (40 is recommended). |
defaultBin |
Which bin to assign when there's only one non-zero quantile. In situations where there's only one non-zero quantile, cut throws an error. Avoid these situations by using a default quantile. |
A vector with same length as vec
but with columns storing
quantiles instead of specificity.
ctd <- ewceData::ctd()
ctd[[1]]$specificity_quantiles <- apply(ctd[[1]]$specificity, 2,
FUN = bin_columns_into_quantiles)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.