distance: Distance measures (between constructs or elements).

Description Usage Arguments Value Author(s) Examples

Description

Distance measures (between constructs or elements). Various distance measures between elements or constructs are calculated.

Usage

1
2
distance(x, along=1, dmethod="euclidean", p=2, trim=20, index=TRUE,
    col.index=FALSE, digits=2, output=1, upper=T, ...)

Arguments

x

repgrid object.

along

Whether to calculate distance for 1 = constructs (default) or for 2= elements.

dmethod

The distance measure to be used. This must be one of "euclidean", "maximum", "manhattan", "canberra", "binary" or "minkowski". Any unambiguous substring can be given. For additional information on the different types type ?dist.

p

The power of the Minkowski distance, in case "minkowski" is used as argument for dmethod.

trim

The number of characters a construct is trimmed to (default is 20). If NA no trimming occurs. Trimming simply saves space when displaying correlation of constructs with long names.

index

Whether to print the number of the construct (default is TRUE).

col.index

Logical. Whether to add an extra index column so the column names are indexes instead of construct names. This option renders a neater output as long construct names will stretch the output (default is FALSE).

digits

Numeric. Number of digits to round to (default is 2).

output

The type of output printed to the console. output=0 will supress printing of the output.

upper

Whether to display upper triangle of correlation matrix only (default is TRUE).

...

Additional parameters to be passed to function dist. Type dist for further information.

Value

matrix object.

Author(s)

Mark Heckmann

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 

# between constructs
distance(bell2010, along=1)
# between elements
distance(bell2010, along=2)

# several distance methods
distance(bell2010, dm="man")         # manhattan distance
distance(bell2010, dm="mink", p=3)   # minkowski metric to the power of 3

# to save the results without printing to the console
d <- distance(bell2010, out=0, trim=7)
d


## End(Not run)

OpenRepGrid documentation built on May 2, 2019, 4:54 p.m.