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

IniListDims

Creates A List Of Integer Ranges


Description

This function generates a list of arrays containing integers greater than or equal to 1. This list of arrays is used in other functions as a list of indices of the elements of the matrices.

Usage

IniListDims(dims, lenlist)

Arguments

dims

The dimensions of a matrix for which we need the possible indices for each dimension. For exemple, if the dimensions sent are c(3,2,5), the following list of arrays will be generated:
list(c(1:3), c(1:2), c(1:5)).

lenlist

'lenlist' is the length of the list because the list will be complemented above length(dims) by arrays of length 1.
For example, if lenlist is set to 7, the previous list of arrays will be extended to:
list(c(1:3), c(1:2), c(1:5), 1, 1, 1, 1).

Value

A list with lenlist elements, each with arrays with integers from 1 to the numbers in dims array and with only 1 for the dimensions above length(dims).

Author(s)

History:
0.1 - 2011-04 (V. Guemas, virginie.guemas@ic3.cat) - Original code
1.0 - 2013-09 (N. Manubens, nicolau.manubens@ic3.cat) - Formatting to R CRAN
1.1 - 2015-03 (N. Manubens, nicolau.manubens@ic3.cat) - Improved

Examples

indices <- IniListDims(c(2, 2, 4, 3), 6)
print(indices)

s2dverification

Set of Common Tools for Forecast Verification

v2.10.0
Apache License 2.0
Authors
BSC-CNS [aut, cph], Virginie Guemas [aut], Nicolau Manubens [aut], An-Chi Ho [ctb, cre], Nuria Perez-Zanon [ctb], Javier Garcia-Serrano [aut], Neven Fuckar [aut], Louis-Philippe Caron [aut], Omar Bellprat [aut], Luis Rodrigues [aut], Veronica Torralba [aut], Alasdair Hunter [aut], Chloe Prodhomme [aut], Martin Menegoz [aut], Domingo Manubens [ctb], Constantin Ardilouze [ctb], Lauriane Batte [ctb], Fabian Lienert [ctb], Julia Giner [ctb], Jean-Philippe Baudouin [ctb], Nube Gonzalez [ctb], Ludovic Auger [ctb], Nicola Cortesi [ctb], Eleftheria Exarchou [ctb], Ruben Cruz [ctb], Isabel Andreu-Burillo [ctb], Ramiro Saurral [ctb]
Initial release

We don't support your browser anymore

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