array of variable length vectors
Giampiero Salvi wrote:
Hi, I'd like to store N vectors of different lengths, and to be able to access them with an index, and eventually free the memory for one of them without modifying the indexes to the others. In C this would be a vector of N pointers that point to memory cells independently allocated. For example int *pv[3]; pv[0] = (int *) malloc(13 * sizeof(int)); pv[1] = (int *) malloc(7 * sizeof(int)); pv[2] = (int *) malloc(110 * sizeof(int)); free(pv[1]) ... What is the best data type (or class) in R to do such a thing?
See ?list Uwe Ligges