TestFunctions (version 0.2.0)

add_null_dims: add_null_dims: Add null dimensions to another function. Allows you to pass in input data with any number of dimensions and it will only keep the first nactive.

Description

add_null_dims: Add null dimensions to another function. Allows you to pass in input data with any number of dimensions and it will only keep the first nactive.

Usage

add_null_dims(func, nactive)

Value

Function that can take any dimensional input

Arguments

func

Function to add null dimensions to

nactive

Number of active dimensions in func

Examples

Run this code
banana(c(.1,.2))
# banana(c(.1,.2,.4,.5,.6,.7,.8)) # gives warning
add_null_dims(banana, nact=2)(c(.1,.2,.4,.5,.6,.7,.8))

Run the code above in your browser using DataLab