Irescale (version 0.2.6)

calculateDistMatrixFromBoard: Calculates the distance in a chessboard-alike structure.

Description

calculateDistMatrixFromBoard calculates the distance matrix when the field is divided in a matrix shape (rows and columns). This board could have different number of columns for each row. For example:

1 1 1 1 1 1
2 2 2 2 2
3 3 3 3 3
4 4 4 4 4

The dimension of obtained squared matrix is given by the square of the maximumn dimension of the original matrix. In the previous example, the matrix will have a size of (36,36).

Usage

calculateDistMatrixFromBoard(data)

Arguments

data

is a 2D data structure.

Value

distM the distance between each cell.

Examples

Run this code
# NOT RUN {
fileInput <- system.file("testdata", "chessboard.csv", package="Irescale")
data<-loadChessBoard(fileInput)
distM<-calculateEuclideanDistance(data$data)
# }

Run the code above in your browser using DataCamp Workspace