Description Usage Arguments Details Value Author(s) See Also Examples
Computes the sum of distances between consecutive samples in a multivariate timeseries. Required to compute the measure of dissimilarity psi
(Birks and Gordon 1985). Distances can be computed through the methods "manhattan", "euclidean", "chi", and "hellinger", and are implemented in the function distance
.
1 2 3 4 5 6 7 8 9 
sequences 
dataframe with one or several multivariate timeseries identified by a grouping column. 
least.cost.path 
a list usually resulting from either 
time.column 
character string, name of the column with time/depth/rank data. The data in this column is not modified. 
grouping.column 
character string, name of the column in 
exclude.columns 
character string or character vector with column names in 
method 
character string naming a distance metric. Valid entries are: "manhattan", "euclidean", "chi", and "hellinger". Invalid entries will throw an error. 
parallel.execution 
boolean, if 
Distances are computed as:
manhattan
: d < sum(abs(x  y))
euclidean
: d < sqrt(sum((x  y)^2))
chi
:
xy < x + y
y. < y / sum(y)
x. < x / sum(x)
d < sqrt(sum(((x.  y.)^2) / (xy / sum(xy))))
hellinger
: d < sqrt(1/2 * sum(sqrt(x)  sqrt(y))^2)
Note that zeroes are replaced by 0.00001 whem method
equals "chi" or "hellinger".
A list with slots named according grouping.column
if there are several sequences in sequences
or a number if there is only one sequence.
Blas Benito <blasbenito@gmail.com>
Birks, H.J.B. and Gordon, A.D. (1985) Numerical Methods in Quaternary Pollen Analysis. Academic Press.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44  #loading data
data(sequenceA)
data(sequenceB)
#preparing datasets
AB.sequences < prepareSequences(
sequence.A = sequenceA,
sequence.A.name = "A",
sequence.B = sequenceB,
sequence.B.name = "B",
merge.mode = "complete",
if.empty.cases = "zero",
transformation = "hellinger"
)
#computing distance matrix
AB.distance.matrix < distanceMatrix(
sequences = AB.sequences,
grouping.column = "id",
method = "manhattan",
parallel.execution = FALSE
)
#computing least cost matrix
AB.least.cost.matrix < leastCostMatrix(
distance.matrix = AB.distance.matrix,
diagonal = FALSE,
parallel.execution = FALSE
)
AB.least.cost.path < leastCostPath(
distance.matrix = AB.distance.matrix,
least.cost.matrix = AB.least.cost.matrix,
parallel.execution = FALSE
)
#autosum
AB.autosum < autoSum(
sequences = AB.sequences,
least.cost.path = AB.least.cost.path,
grouping.column = "id",
parallel.execution = FALSE
)
AB.autosum

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.