<div dir="ltr">I am working with hundreds of genpop objects indexed in a list.  Using lapply and makefreq functions, population gene frequencies were stored in individual objects (1 per data set).<div><br></div><div>Here is an example with just three objects:</div><div><div><br></div><div>>summary(mygenpop)</div><div>                  Length Class  Mode</div><div>data1.str 1      genpop S4  </div><div>data2.str 1      genpop S4  </div><div>data3.str 1      genpop S4  </div></div><div><br></div><div>>mygenfreq <- lapply(mygenpop, function(x) makefreq(x, truenames=TRUE))</div><div><br></div><div>>summary(mygenfreq)<br></div><div><div>                  Length Class  Mode</div><div>data1.str 3      -none- list</div><div>data2.str 3      -none- list</div><div>data3.str 3      -none- list</div></div><div><br></div><div>>summary(mygenfreq[[1]]$tab)</div><div><div>> str(mygenfreq[[1]])</div><div> $ tab : num [1:30, 1:1974] 0.6 0.5 0.325 0.675 0.6 0.5 0.5 0.375 0.55 0.475 ...<br></div><div> $ nobs: num [1:30, 1:1000] 40 40 40 40 40 40 40 40 40 40 ...</div><div><br></div></div><div>Next job is to work with the $tab matrix, but I am not sure how to access it from all objects in one command.</div><div><br></div><div>>mygenfreqT <- lapply(mygenfreq[[1:3]]$tab, function(x) t(x))</div><div><br></div><div>This throws an error.   The syntax seems to be wrong, but I am not sure how to fix this.  Thanks for any help.</div><div><br></div><div>Vikram</div><div><br></div><div><br></div></div>