check.func: Check function: function

View source: R/checks.R

check.funcR Documentation

Check function: function

Description

This function checks whether the class of the function provided by the user is function, and whether the output produced by the function is numeric with the correct dimension. If not, an error message is displayed.

Usage

check.func(f, A, data, name.var, name.A, mat.type)

Arguments

f

The function to be tested.

A

A matrix that contains the information about the dimension for the output of f.

data

A data frame.

name.var

The name of the variable.

name.A

The name of the matrix A.

mat.type

The type of the matrix to be checked.

Value

Returns the output of the function in the format of numeric and the correct dimension.

  • If mat.type is col, then a column vector is returned.

  • If mat.type is matrix, then a square matrix is returned.


conroylau/lpinfer documentation built on Sept. 5, 2024, 9 p.m.