View source: R/helper_functions_application.R

restructure_as_list | R Documentation |

This function restructures neighborhood information given by a data matrix
containing all information and one neighborhood assignment vector. It returns a list
of data matrices used in `ssMRCD`

.

```
restructure_as_list(data, neighborhood_vec)
```

`data` |
data matrix with all observations. |

`neighborhood_vec` |
numeric neighborhood assignment vector.
Should contain numbers from |

Returns a list containing the observations per neighborhood assignment.

```
# data matrix
data = matrix(rnorm(n = 3000), ncol = 3)
N_assign = sample(x = 1:10, size = 1000, replace = TRUE)
restructure_as_list(data, N_assign)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.