makedist: Auxiliary function to make Dissimilarity Matrices

Description Usage Arguments Value Author(s) Examples

View source: R/makedist.R

Description

This function makes a distance matrix from a set of arguments

Usage

1
makedist(data, dist.fun, dist.data.arg, dist.args)

Arguments

data

A numeric data frame or matrix of variables to be scaled. Column names will be propagated through the function as the names of stimuli. This data frame must contain only the variables to be scaled.

dist.fun

A character string identifying the name of the distance function to be used. We have included in this package a function to calculate Rabinowitz' Line-of-Sight distance. The dist function from the MASS library is another option. Users can provide their own function so long as it returns the distance/dissimilarity matrix in its object ‘dist’

dist.data.arg

A character string giving the name of the data argument to the distance function

dist.args

Optional arguments to be passed to the distance function - must not be NULL

Value

dist

Distance matrix returned from the distance function. If the distance function is user-defined, it must return the distance matrix in its dist element.

Author(s)

Dave Armstrong and William Jacoby

Examples

1
2
3
4
data(thermometers2004)
d <- makedist(thermometers2004, dist.fun = "dist", dist.data.arg = "x", 
	dist.args=list(method="euclidian"))
d

davidaarmstrong/bsmds documentation built on May 6, 2019, 8:32 p.m.