generate_report_ccanberra: Generate a Microsoft Word document about the Canberra...

View source: R/cmahalanobis.R

generate_report_ccanberraR Documentation

Generate a Microsoft Word document about the Canberra distances matrix or matrices (two or more) and the p-values matrix or matrices (two or more).

Description

This function takes a dataframe, a factor or factors (two or more) and returns a Microsoft Word document about the Canberra distances matrix or matrices (two or more) and the p-values matrix or matrices (two or more).

Usage

generate_report_ccanberra(
  dataset,
  formula,
  pvalue.method = "permutation",
  seed = NULL,
  min_group_size = 3
)

Arguments

dataset

A dataframe.

formula

A variable or variables (two or more) with factors which you want to calculate the Canberra distances matrix or matrices (two or more) and the p_values matrix or matrices (two or more).

pvalue.method

A p_value method used to calculate the matrix or matrices (two or more), the default value is "permutation". Another method is "bootstrap".

seed

Optionally, set a seed for "bootstrap" and "permutation".

min_group_size

Minimum group size to maintain. The default value is 3, therefore groups, inside variables, with less than 3 observations will be discarded.

Value

A Microsoft Word document about the Canberra distances matrix or matrices (two or more) and the p_values matrix or matrices (two or more).

Examples

# Example with iris dataset
data(iris)

# Generate a report about "Species" factor in iris dataset
generate_report_ccanberra(iris, ~Species, 
pvalue.method = "permutation")

# Example with mtcars dataset
data(mtcars)

# Generate a report about "am" factor in mtcars dataset
generate_report_ccanberra(mtcars, ~am, 
pvalue.method = "bootstrap", seed = 123)

# Generate a report for 32 car models in "mtcars" dataset,
# using "bootstrap" method
generate_report_ccanberra(mtcars, ~am, pvalue.method = "bootstrap")


cmahalanobis documentation built on Sept. 14, 2025, 5:09 p.m.