Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

expand.int

Function to expand integers to a grid of indices


Description

This function takes an arbitrary number K of integer values n_1,…, n_K and creates a data frame with all combinations from 1:n_k, where the first column (taking values from 1 to n_1) varies slowest and the last column (())taking values from 1 to n_K) varies fastest. Internally, this function depends on expand.grid

Usage

expand.int(...)

Arguments

...

An arbitrary number of integer values.

Value

A dataframe with the same number of columns as integers supplied and containing all combinations of indices from 1 to the given integers. If no number is supplied, the function returns NULL.

Examples

# For two integers
funData:::expand.int(2,5) # first column varies slowest

# For three integers
funData:::expand.int(2,3,4)

funData

An S4 Class for Functional Data

v1.3-5
GPL-2
Authors
Clara Happ-Kurz [aut, cre]
Initial release
2020-04-23

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.