compare_expousre_sets {YAPSA} | R Documentation

## Compare two sets of exposures by cosine distance

### Description

Compare two sets of exposures, stored in numerical data frames `H1` and `H2`, by computing the row-wise cosine distance

### Usage

    compare_expousre_sets(in_df_small, in_df_big, in_distance = cosineDist)

### Arguments

`in_df_small, in_df_big` | Numerical data frames `H1` and `H2`, ideally the bigger one first, both with `l` rows and `m1` and `m2` columns, `l` being the number of signatures and `m1` and `m2` being the respective numbers of samples or patient identefier of `H1` and `H2`
`in_distance` | A function which computes the distance measure, default is `cosineDist`

### Value

A list with entries `distance`, `hierarchy_small` and `hierarchy_big`.

- `distance`: A numerical data frame with the cosine distances between the columns of `H1`, indexing the rows, and `H2`, indexing the columns

- `hierarchy_small`: A data frame carrying the information of ranked similarity between the signatures in `H2` with the signatures in `H1`

- `hierarchy_big`: A data frame carrying the information of ranked similarity between the signatures in `H1` with the signatures in `H2`

### See Also

`cosineDist`

### Examples

    sig_1_df <- data.frame(matrix(c(1,0,0,0,0,1,0,0,0,0,1,0),ncol=3))
    names(sig_1_df) <- paste0("B",seq_len(dim(sig_1_df)[2]))
    sig_2_df <- data.frame(matrix(c(1,1,0,0,0,0,1,1),ncol=2))
    compare_expousre_sets(sig_1_df,sig_2_df)

[Package YAPSA version 1.18.0 Index]