spherize transforms specified observation variables by estimating a sphering transformation on a sample and applying it to the population.

spherize(population, variables, sample, regularization_param = 1)

Arguments

population

tbl with grouping (metadata) and observation variables.

variables

character vector specifying observation variables.

sample

tbl containing sample that is used by the method to estimate sphering parameters. sample has same structure as population. Typically, sample corresponds to controls in the experiment.

regularization_param

optional parameter used in sphering to offset eigenvalues to avoid division by zero.

Value

transformed data of the same class as population.

Examples

population <- tibble::tibble( Metadata_Well = c("A01", "A02", "B01", "B02"), Intensity_DNA = c(8, 20, 12, 32), Texture_DNA = c(5, 2, 43, 13) ) variables <- c("Intensity_DNA", "Texture_DNA") spherize(population, variables, population, 0.01)
#> # A tibble: 4 x 3 #> Metadata_Well PC1 PC2 #> <chr> <dbl> <dbl> #> 1 A01 -0.474 1.13 #> 2 A02 -0.734 0.0260 #> 3 B01 1.47 0.144 #> 4 B02 -0.264 -1.30