<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>