| Author |
Comment/Response |
Randy Silvers
|
05/18/08 03:19am
You'll want to use Partition and Take. If your data is in the matrix mat, and num is the number of rows per country (31 in your case)
Partition[mat,num] generates a three-dimensional matrix -- the first dimension is the number of countries, and each of these "elements" is a matrix with 31 rows.
Then, Map[Take[#,numvars]&,Partition[mat,num]] will take the first numvars rows from each element of the partitioned mat. For your current data set, you want Map[Take[#,10]&,Partition[mat,31]]
URL: sirandol@deakin.edu.au, |
|