Displaying 1 result from an estimated 1 matches for "indvecstr".
Did you mean:
indexstr
2006 Oct 19
2
arraytake for extracting subarrays from multidimensional arrays
...t expression. This way one does not need to
specify the number of
#commas.
if(length(dim(x)) != length(indlist)) {
return(); #we would put some error message here in production code
}
#First build up a string w/ indices for each dimension
d <- length(indlist); #number of dims
indvecstr <- matrix(0,d,1);
for(i in 1:d) {
if(is.null(indlist[[i]])) {
indvecstr[i] <- "";
} else{
indvecstr[i] <-
paste("c(",paste(indlist[[i]],sep="",collapse=","),")",sep="")
}
}
#Then build up the argumen...