PropToroShiftData: Apply a toroidal shift to the pooled samples using a...

View source: R/RcppExports.R

PropToroShiftDataR Documentation

Apply a toroidal shift to the pooled samples using a proportion of points

Description

The PropToroShiftData() function produces a list of toroidal shifted versions of the two-column input matrix. The number of toroidal shifts is (the ceiling of) the proportion (propPnts) multiplied by the combined sample size. The origins of the toroidal shifts are randomly selected from the combined samples. The pooled data is assumed to list all of the first sample of size n1 before the second sample (of size n2).

Usage

PropToroShiftData(data, n1, n2, propPnts = 1)

Arguments

data

A two column matrix of the pooled samples

n1

An integer sample size for the first sample

n2

An integer sample size for the second sample

propPnts

A numeric proportion of points to be used as toroidal shift origins

Value

A list of toroidal shifted pooled sample matrices

Examples

data(iris)
sample1 <- as.matrix(iris[iris$Species == "setosa", 1:2])
sample2 <- as.matrix(iris[iris$Species == "virginica", 1:2])
pooled_data <- rbind(sample1, sample2)
n1 <- nrow(sample1)
n2 <- nrow(sample2)

# Creates a list of 0.1 times (n1 + n2) = 10 toroidal shifts of the pooled data
output <- PropToroShiftData(pooled_data, n1, n2, 0.1)
summary(output)

EricMcKinney77/distdiffR documentation built on April 24, 2022, 9:03 p.m.