lddf_work: Does the actual gathering and spreading without testing...

View source: R/long_distance_df.R

lddf_workR Documentation

Does the actual gathering and spreading without testing assumptions

Description

lddf_work Used internally by long_distance_df(). I recommend you use that function unless you really know what you're doing. This function does the actual gathering, spreading, and joining associated with making the lddf, but without checking if the distance matrix is sensible or removing diagonals and repeats. Use this function if you know exactly what you want and have trimmed your distance matrix down to only what you know you need. Good for permutation tests.

Usage

lddf_work(
  dmat,
  metadat,
  idcol = "X.SampleID",
  suff = c("1", "2"),
  distcol = "Distance"
)

Arguments

dmat

A distance matrix or other diagonal matrix object with sample names as row and column names.

metadat

A data frame or data frame-like object with the data set's metadata

idcol

('X.SampleID'.) A string. The column in metadat that holds the sample names. Sample names should match the row/column namse of the distance matrix. If there are samples in the metadata data frame that are missing from the distance matrix, they will be excluded with a warning. If there are samples in the distance matrix that are missing from the metadata, you will get an error.

suff

(c('1','2').) A character vector of length 2. The suffixes to be appended to the metadata column names in the output. The two elements must not be identical.

distcol

('Distance'.) A string. The desired column name for the distance column in your long data frame. Only here to avoid clashes with existing metadata column names.


JCSzamosi/aftersl1p documentation built on July 3, 2025, 8:37 p.m.