[adegenet-forum] sPCA randtest in adegenet devel

David Dayan snook91901 at gmail.com
Wed Oct 4 00:47:42 CEST 2017


Hi,

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.

I'm trying to get to the bottom of an error running the new spca_randtest
function in the development package.

The error I receive is:
Error in 1:nrow(obj) : argument of length 0

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:

>nrow(oc_spca)
NULL

>nrow(oc.gid)
NULL

I also attempted to run spca_randtest on the example spca data, spcaIllus,
and was successful.

Can anyone venture a guess as to what's happening here? I've copied the
summary of the spca object below

Thanks,
David

########################################
# spatial Principal Component Analysis #
########################################
class: spca
$call: spca(obj = oc.gid, xy = xy_oc_jitter)

$nfposi: 2 axis-components saved
$nfnega: 1 axis-components saved
Positive eigenvalues: 8.311 6.044 5.207 5.179 4.758 ...
Negative eigenvalues: -3.39 -3.045 -2.905 -2.848 -2.757 ...

  vector length mode    content
1 $eig   167    numeric eigenvalues

  data.frame nrow                                          ncol
1 $tab       transformed data: optionally centred / scaled $tab
2 $c1        10898                                         3
3 $li        113                                           3
4 $ls        113                                           3
5 $as        2                                             3
  content
1 transformed data: optionally centred / scaled
2 principal axes: scaled vectors of alleles loadings
3 principal components: coordinates of entities ('scores')
4 lag vector of principal components
5 pca axes onto spca axes

$xy: matrix of spatial coordinates
$lw: a list of spatial weights (class 'listw')

other elements: NULL
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20171003/ca8aa5ca/attachment.html>


More information about the adegenet-forum mailing list