<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi,</p>
<p>I've been using sPCA over the past couple of years, and run into
an error that appears to be due to different numbers of
eigenvalues generated by the spca function. When I run it
repeatedly, many times I get the following error when I try to
generate the screeplot: <br>
</p>
<p><span style="color: rgb(197, 6, 11); font-family: Monaco,
monospace; font-size: 13.3333px; font-style: normal;
font-variant-ligatures: normal; font-variant-caps: normal;
font-weight: 400; letter-spacing: normal; orphans: 2;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(229, 229,
229); text-decoration-style: initial; text-decoration-color:
initial; display: inline !important; float: none;">Error in
data.frame(eig = eig, var = varspa, moran = moran/varspa) :
arguments imply differing number of rows: 40, 34</span></p>
<p>each time I run it, the number of eigenvalues changes (e.g., 40
in this case). spca functions such as screeplot and plot will not
function if the number of eigen values doesn't match the number of
samples minus one (n-1). <br>
</p>
<p>I am using jitter to randomly shift the lat/lon coordinates each
time, as some of the samples have the same coordinates. <br>
</p>
<p>The command lines are:</p>
<p>obj.s<-obj<br>
obj.s$other$xy<-jitter(obj$other$xy, factor = 0.5) <br>
mySpca <- spca(obj.s, ask=T, type=1, scannf=F, nfposi = 4,
nfnega = 0, scale=T) # method used by LL<br>
</p>
<p>where obj is a genind object with the lat/lon positions in
obj$other$xy.</p>
<p>Can anyone tell me why the number of eigenvalues changes, and how
to fix this problem? For some datasets, the function fails
(generates too many eigenvalues) most of the time. If I continue
to re-run it, and change the jitter factor, I can usually get it
to run properly eventually (after many replicates). <br>
</p>
<p>Phil<br>
</p>
<pre class="moz-signature" cols="72">--
--
Phillip A. Morin, Ph.D.
Southwest Fisheries Science Center
8901 La Jolla Shores Dr.
La Jolla, CA 92037, USA
Phone: 858-546-7165
Fax: 858-546-7003
<a class="moz-txt-link-abbreviated" href="mailto:phillip.morin@noaa.gov">phillip.morin@noaa.gov</a>
<a class="moz-txt-link-freetext" href="http://swfsc.noaa.gov/mmtd-mmgenetics">http://swfsc.noaa.gov/mmtd-mmgenetics</a></pre>
</body>
</html>