Description Usage Arguments Details Value Author(s) See Also Examples

The make.phantoms function will take an *N*x*N* matrix and add
*NP* phantom elements, thus creating a matrix with *N+NP*x*N+NP*
dimensions.

1 | ```
make.phantoms(x, nphantoms, name = "phantom", maxval = Inf, ...)
``` |

`x` |
A matrix or data.frame object, with |

`nphantoms` |
An integer, providing the number of phantom elements to add. |

`name` |
A character string, indicating the name attribute for new elements. Defaults to "phantom". |

`maxval` |
An integer value, the default value to give the pairs of phantoms (indeces [N+1:N+NP, N+1:N+NP]), assumed to be a maximum distance. Defaults to Inf. |

`...` |
Additional arguments, not used at this time. |

This function is internal to the `gendistance`

function, but may be
useful in manufacturing personalized distance matrices. Phantoms are fake
elements that perfectly match all elements. They can be used to discard a
certain number of elements.

a matrix or data.frame object

Cole Beck

1 2 3 4 5 6 7 8 | ```
# 5x5 distance matrix
dist.mat <- matrix(c(0,5,10,15,20,5,0,15,25,35,10,15,0,25,40,15,25,25,0,15,20,35,40,15,0), nrow=5)
# add one phantom element
dm.ph <- make.phantoms(dist.mat, 1)
# create distancematrix object
distancematrix(dm.ph)
# add three phantoms
make.phantoms(dist.mat, 3)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.