tidy_to_matrix: Convert from tidy to matrix

View source: R/mcpfit_methods.R

tidy_to_matrixR Documentation

Convert from tidy to matrix

Description

Converts from the output of tidy_samples() or pp_eval(fit, samples_format = "tidy") to an N_draws X nrows(newdata) matrix with fitted/predicted values. This format is used y brms and it's useful as yrep in bayesplot::ppc_* functions.

Usage

tidy_to_matrix(samples, returnvar)

Arguments

samples

Samples in tidy format

returnvar

An rlang::sym() object.

Value

An N_draws X nrows(newdata) matrix.

Author(s)

Jonas Kristoffer Lindeløv jonas@lindeloev.dk


mcp documentation built on March 18, 2022, 6:41 p.m.