matrix_arrange: Arrange Vectorised Matrix Samples

Description Usage Arguments Value Examples

View source: R/matrix_arrange.R

Description

A convenience function used to arrange vectorised matrix samples into the correct matrix format for several functions used to specify Markov model. See example_two_state_markov for an example use case. Both a R and C++ implementation are available.

Usage

1
matrix_arrange(samples, type = "rcpp")

Arguments

samples

A list of vectorised matrix samples

type

A character string specifying the approach to use. Currently implemented approaches are "base", and "rcpp" with "rcpp" as the default.

Value

A list of matrices with each matrix representing a single sample.

Examples

1
2
3
4
5
6
7
8
9
matrix_samples <- list(VGAM::rdiric(1:5, c(88, 12)),
                       VGAM::rdiric(1:5, c(8, 92)))

# Default usage
matrix_arrange(matrix_samples)
# R implementation
matrix_arrange(matrix_samples, type = "base")
# Rcpp implementation
matrix_arrange(matrix_samples, type = "rcpp")

seabbs/SpeedyMarkov documentation built on Dec. 26, 2019, 4:38 a.m.