workflowNullPsiHP: Computes the dissimilarity measure _psi_ on restricted...

Description Usage Arguments Value Author(s) Examples

View source: R/workflowNullPsiHP.R

Description

The function first computes psi on the observed sequences, and then computes it on permutations of the input sequences by the repetitions argument. The data is randomized as follows: within each column, each data-point can be: 1) left as is; 2) replaced by the previous case; 3) replaced by the next case. The action applied to each data-point is selected randomly, and independently from the actions applied to other data-points. This type of randomization generates versions of the dataset that have the same general structure as the original one, but small local and independent changes only ocurring within the immediate neighborhood (one row up or down) of each case in the table. The method should generate very conservative random values of psi.

Usage

1
2
3
4
5
6
7
8
workflowNullPsiHP(
  sequences = NULL,
  grouping.column = NULL,
  time.column = NULL,
  exclude.columns = NULL,
  parallel.execution = TRUE,
  repetitions = 9
  )

Arguments

sequences

dataframe with multiple sequences identified by a grouping column generated by prepareSequences.

grouping.column

character string, name of the column in sequences to be used to identify separates sequences within the file.

time.column

character string, name of the column with time/depth/rank data.

exclude.columns

character string or character vector with column names in sequences to be excluded from the analysis.

parallel.execution

boolean, if TRUE (default), execution is parallelized, and serialized if FALSE.

repetitions

integer, number of null psi values to obtain.

Value

A list with two slots:

Author(s)

Blas Benito <blasbenito@gmail.com>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#load data
data("sequencesMIS")

#prepare sequences
MIS.sequences <- prepareSequences(
  sequences = sequencesMIS,
  grouping.column = "MIS",
  transformation = "hellinger"
  )

#execute workflow to compute psi
MIS.null.psi <- workflowNullPsiHP(
 sequences = MIS.sequences[MIS.sequences$MIS %in% c("MIS-1", "MIS-2"), ],
 grouping.column = "MIS",
 repetitions = 3,
 parallel.execution = FALSE
 )

MIS.null.psi

distantia documentation built on Oct. 30, 2019, 10:05 a.m.