Initializes various data structures for storing and managing data within a complex systems analysis framework.
Arguments
- type
A character string specifying the type of data structure to initialize: "array", "vector", "matrix", or "neighborhood memories". Each structure serves different requirements for data storage and processing in the model.
- dimensions
An integer vector specifying the dimensions of the data structure. The interpretation of dimensions varies based on the type:
For "array", it defines the dimensions of the array.
For "vector", only the first element (length) is used.
For "matrix", the first two elements specify the number of rows and columns.
For "neighborhood memories", the first two elements define the number of rows and columns, the third element specifies the number of nearest neighbors, and the fourth element details the number of signature components per neighbor.
Value
db Returns the initialized data structure, filled with NA values. Depending on the 'type', the structure can be an array, vector, matrix, or a specialized data frame designed for neighborhood memories which incorporates extensive details about interactions within defined neighborhoods.
Examples
# Initialize a matrix with 3 rows and 5 columns.
matrix_db <- dataBank("matrix", c(3, 5))
print(matrix_db)
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] NA NA NA NA NA
#> [2,] NA NA NA NA NA
#> [3,] NA NA NA NA NA
# Initialize a neighborhood memory structure correctly with sufficient column names.
dimensions_nm <- c(4, 40, 3, 5)
nm_db <- dataBank("neighborhood memories", dimensions_nm)
print(nm_db)
#> i nn-times nn-times nn-times nn-dists nn-dists nn-dists nn-weights
#> 1 NA NA NA NA NA NA NA NA
#> 2 NA NA NA NA NA NA NA NA
#> 3 NA NA NA NA NA NA NA NA
#> 4 NA NA NA NA NA NA NA NA
#> nn-weights nn-weights nn-patt nn-patt nn-patt Sig-Comp. 1 of NN1
#> 1 NA NA NA NA NA NA
#> 2 NA NA NA NA NA NA
#> 3 NA NA NA NA NA NA
#> 4 NA NA NA NA NA NA
#> Sig-Comp. 2 of NN1 Sig-Comp. 3 of NN1 Sig-Comp. 4 of NN1
#> 1 NA NA NA
#> 2 NA NA NA
#> 3 NA NA NA
#> 4 NA NA NA
#> Sig-Comp. 1 of NN2 Sig-Comp. 2 of NN2 Sig-Comp. 3 of NN2
#> 1 NA NA NA
#> 2 NA NA NA
#> 3 NA NA NA
#> 4 NA NA NA
#> Sig-Comp. 4 of NN2 Sig-Comp. 1 of NN3 Sig-Comp. 2 of NN3
#> 1 NA NA NA
#> 2 NA NA NA
#> 3 NA NA NA
#> 4 NA NA NA
#> Sig-Comp. 3 of NN3 Sig-Comp. 4 of NN3 Coord. 1 of NN1 Coord. 2 of NN1
#> 1 NA NA NA NA
#> 2 NA NA NA NA
#> 3 NA NA NA NA
#> 4 NA NA NA NA
#> Coord. 3 of NN1 Coord. 4 of NN1 Coord. 5 of NN1 Coord. 1 of NN2
#> 1 NA NA NA NA
#> 2 NA NA NA NA
#> 3 NA NA NA NA
#> 4 NA NA NA NA
#> Coord. 2 of NN2 Coord. 3 of NN2 Coord. 4 of NN2 Coord. 5 of NN2
#> 1 NA NA NA NA
#> 2 NA NA NA NA
#> 3 NA NA NA NA
#> 4 NA NA NA NA
#> Coord. 1 of NN3 Coord. 2 of NN3 Coord. 3 of NN3 Coord. 4 of NN3
#> 1 NA NA NA NA
#> 2 NA NA NA NA
#> 3 NA NA NA NA
#> 4 NA NA NA NA
#> Coord. 5 of NN3
#> 1 NA
#> 2 NA
#> 3 NA
#> 4 NA