<div dir="ltr">Hi,<div><br></div><div>I've been a longtime user of this forum, but never a poster, so first thanks to Thibaut and everyone on the team for their work in keeping the forum such a useful place.</div><div><br></div><div>I'm trying to get to the bottom of an error running the new spca_randtest function in the development package. </div><div><br></div><div>The error I receive is:</div><div>Error in 1:nrow(obj) : argument of length 0<br></div><div><br></div><div>I looked to see if the the nrow function worked on either the spca object or the genind obj that I ran the spca on:</div><div><br></div><div>>nrow(oc_spca)</div><div>NULL</div><div><br></div><div><div>>nrow(oc.gid)</div><div>NULL</div></div><div><br></div><div>I also attempted to run spca_randtest on the example spca data, spcaIllus, and was successful.</div><div><br></div><div>Can anyone venture a guess as to what's happening here? I've copied the summary of the spca object below</div><div><br></div><div>Thanks,</div><div>David</div><div><br></div><div><div><span style="white-space:pre">  </span>########################################</div><div><span style="white-space:pre">      </span># spatial Principal Component Analysis #</div><div><span style="white-space:pre">      </span>########################################</div><div>class: spca</div><div>$call: spca(obj = oc.gid, xy = xy_oc_jitter)</div><div><br></div><div>$nfposi: 2 axis-components saved</div><div>$nfnega: 1 axis-components saved</div><div>Positive eigenvalues: 8.311 6.044 5.207 5.179 4.758 ...</div><div>Negative eigenvalues: -3.39 -3.045 -2.905 -2.848 -2.757 ...</div><div><br></div><div>  vector length mode  Â  content  Â Â </div><div>1 $eig  Â 167  Â  numeric eigenvalues</div><div><br></div><div>  data.frame nrow  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  ncol</div><div>1 $tab  Â  Â  Â transformed data: optionally centred / scaled $tab</div><div>2 $c1  Â  Â  Â  10898  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â 3  Â </div><div>3 $li  Â  Â  Â  113  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â 3  Â </div><div>4 $ls  Â  Â  Â  113  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â 3  Â </div><div>5 $as  Â  Â  Â  2  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â 3  Â </div><div>  content  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â </div><div>1 transformed data: optionally centred / scaled  Â  Â  Â  Â  Â </div><div>2 principal axes: scaled vectors of alleles loadings  Â  Â Â </div><div>3 principal components: coordinates of entities ('scores')</div><div>4 lag vector of principal components  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â Â </div><div>5 pca axes onto spca axes  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â </div><div><br></div><div>$xy: matrix of spatial coordinates</div><div>$lw: a list of spatial weights (class 'listw')</div><div><br></div><div>other elements: NULL</div></div></div>