bnec_newdata {bayesnec}R Documentation

bnec_newdata

Description

Create a dataset for predictions

Usage

bnec_newdata(x, resolution = 100, x_range = NA)

Arguments

x

An object of class bayesnecfit or bayesmanecfit as returned by bnec.

resolution

A numeric vector of length 1 indicating the number of x values over which to predict values.

x_range

A numeric vector of length 2 indicating the range of x values over which to make predictions.

Value

A data.frame to be used in predictions.

Examples

## Not run: 
library(bayesnec)
nec4param <- pull_out(manec_example, model = "nec4param")
# Make fine resolution, predict out of range
newdata <- bnec_newdata(nec4param, resolution = 200, x_range = c(0, 4))
nrow(newdata) == 200
all(range(newdata$x) == c(0, 4))
newdata2 <- bnec_newdata(manec_example) # default size
nrow(newdata2) == 100

## End(Not run)


[Package bayesnec version 2.1.2.0 Index]