search for: lastsubscript

Displaying 1 result from an estimated 1 matches for "lastsubscript".

2011 Nov 01
4
building a subscript programatically
Hi, On ocasion, you need to subscript an array that has an arbitrary (ie. not known in advance) number of dimensions. How do you deal with these situations? It appears that it is not possible use a list as an index, for instance this fails: > x <- array(NA, c(2,2,2)) > x[list(TRUE,TRUE,2)] Error in x[list(TRUE, TRUE, 2)] : invalid subscript type 'list' The only way I know is