Skip to contents

This function will compare the isolate to their nearest neighbor generated from phyloAMR::nearest_neighbor_algorithm(). Has functionality for categorical and continuous variables.

Usage

nearest_neighbor_analysis(
  nearest_neighbor_df,
  categorical_vars = NULL,
  binary_vars = NULL,
  continuous_vars = NULL,
  log_2 = FALSE
)

Arguments

nearest_neighbor_df

Dataframe with isolates and their nearest neighbors. Can work on

categorical_vars

Categorical variables. Must be in the nearest_neighbor_df

binary_vars

Binary variables. Must be in the nearest_neighbor_df AND coded 0 and 1.

continuous_vars

Continuous variables. Must be in the nearest_neighbor_df

log_2

Boolean (TRUE/FALSE) Whether to perform log-2 transformation on continuous variables

Value

Dataframe with differences in the categorical and continuous variables between an isolate and their nearest neighbor

Details

This function will use the phylogenetic tree to identify an isolate's nearest neighbor.