<html><body><div style="font-family: trebuchet ms,sans-serif; font-size: 12pt; color: #000000"><div>You do not see any added points because the two sets of data are on a different scale. The loadings are in its own system and are not compatible with your map. See page 36 - points are plotted using function s.value using coordinate from other(rupica)$xy and using loadings of PCA to determine the size of the squares.<br></div><div><br data-mce-bogus="1"></div><div>Can you provide a small reproducible example?<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Cheers,<br data-mce-bogus="1"></div><div>Roman<br data-mce-bogus="1"></div><div><br></div><div data-marker="__SIG_PRE__">----<br>In god we trust, all others bring data.<br>> Zahtevaj IJZ na https://kurc.biolitika.si</div><br><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><b>From: </b>"Caroline Judy" <caroline.duffie@gmail.com><br><b>To: </b>adegenet-forum@lists.r-forge.r-project.org<br><b>Sent: </b>Monday, November 6, 2017 9:37:15 PM<br><b>Subject: </b>[adegenet-forum] help with sPCA basics: plotting the raster map with xy points<br></div><br><div data-marker="__QUOTED_TEXT__"><div dir="ltr"><div class="gmail-adn gmail-ads" style="padding-bottom:20px;padding-left:8px;font-size:medium"><div class="gmail-gs" style="margin-left:44px"><div id="gmail-:2bd" class="gmail-ii gmail-gt gmail-adP gmail-adO" style="font-size:12.8px;margin-bottom:0px;margin-left:0px;padding-bottom:5px"><div id="gmail-:2bc" class="gmail-a3s gmail-aXjCH gmail-m15f93028b2e90d3d"><div dir="ltr">Dear Adegenet forum,<br></div></div></div></div><div class="gmail-gs" style="margin-left:44px"><div id="gmail-:2bd" class="gmail-ii gmail-gt gmail-adP gmail-adO" style="font-size:12.8px;margin-bottom:0px;margin-left:0px;padding-bottom:5px"><div id="gmail-:2bc" class="gmail-a3s gmail-aXjCH gmail-m15f93028b2e90d3d"><div dir="ltr"><div>Sorry for the incomplete email I accidentally sent just a few minutes ago. Here's the full email:</div></div></div></div></div><div class="gmail-gs" style="margin-left:44px"><div id="gmail-:2bd" class="gmail-ii gmail-gt gmail-adP gmail-adO" style="font-size:12.8px;margin-bottom:0px;margin-left:0px;padding-bottom:5px"><div id="gmail-:2bc" class="gmail-a3s gmail-aXjCH gmail-m15f93028b2e90d3d"><div dir="ltr"><br><div>As a first step to the sPCA, I am trying to plot my xy points on the map of my study region similar to the example "rupica" in the SPCA tutorial that appears on page 27, using the following code:</div><br><div><span class="gmail-m_2087764598351393534gmail-s1" style="font-size:12.8px">plot(</span><span style="font-size:12.8px">data</span><span class="gmail-m_2087764598351393534gmail-s1" style="font-size:12.8px">$</span><span style="font-size:12.8px">other</span><span class="gmail-m_2087764598351393534gmail-s1" style="font-size:12.8px">$</span><span style="font-size:12.8px">topo.jam</span><span class="gmail-m_2087764598351393534gmail-s1" style="font-size:12.8px">)</span><br></div><div><p class="gmail-m_2087764598351393534gmail-p1"><span class="gmail-m_2087764598351393534gmail-s1"></span></p><p class="gmail-m_2087764598351393534gmail-p1">points(<span class="gmail-m_2087764598351393534gmail-s1">xy</span>,<span class="gmail-m_2087764598351393534gmail-s1">col</span>=<span class="gmail-m_2087764598351393534gmail-s2">"red"</span>, <span class="gmail-m_2087764598351393534gmail-s1">pch</span>=<span class="gmail-m_2087764598351393534gmail-s3">20</span>)</p><p class="gmail-m_2087764598351393534gmail-p1"><span style="font-size:12.8px">I don't get an error message, but the points won't draw on the map. A pdf of the map is attached (sans plots). Is this a format issue with the raster file? I've tried running the code with the xy data and map stored outside of the genind object, to no avail.</span></p><p class="gmail-m_2087764598351393534gmail-p1"><span style="font-size:12.8px"><br></span></p></div></div></div></div></div><div class="gmail-gs" style="margin-left:44px"><div id="gmail-:2bd" class="gmail-ii gmail-gt gmail-adP gmail-adO" style="font-size:12.8px;margin-bottom:0px;margin-left:0px;padding-bottom:5px"><div id="gmail-:2bc" class="gmail-a3s gmail-aXjCH gmail-m15f93028b2e90d3d"><div dir="ltr"><div><p class="gmail-m_2087764598351393534gmail-p1"><span style="font-size:12.8px">Thanks in advance for any assistance</span></p></div></div></div></div></div><div class="gmail-gs" style="margin-left:44px"><div id="gmail-:2bd" class="gmail-ii gmail-gt gmail-adP gmail-adO" style="font-size:12.8px;margin-bottom:0px;margin-left:0px;padding-bottom:5px"><div id="gmail-:2bc" class="gmail-a3s gmail-aXjCH gmail-m15f93028b2e90d3d"><div dir="ltr"><div><div><div>---------------</div><br><div><div>/// GENIND OBJECT /////////</div><br><div> // 158 individuals; 6,451 loci; 12,902 alleles; size: 10.7 Mb</div><br><div> // Basic content</div><div> @tab: 158 x 12902 matrix of allele counts</div><div> @loc.n.all: number of alleles per locus (range: 2-2)</div><div> @loc.fac: locus factor for the 12902 columns of @tab</div><div> @all.names: list of allele names for each locus</div><div> @ploidy: ploidy of each individual (range: 2-2)</div><div> @type: codom</div><div> @call: read.structure(file = "~/Documents/Trochilus/second_chapter/Analysis/structure/input/GBS_all_pop_pheno.stru", </div><div> n.ind = 158, n.loc = 6451, onerowperind = TRUE, col.lab = 1, </div><div> col.pop = 2, col.others = 3:8, row.marknames = 0, ask = FALSE)</div><br><div> // Optional content</div><div> @pop: population of each individual (group size range: 6-37)</div><div> @strata: a data frame with 3 columns ( sex, phenotype, HI )</div><div> @other: a list containing: X xy topo topo.east topo.jam </div><div>--------------------------------------------------------------------------------------</div></div></div><div><div>$topo.jam</div><div>class : RasterLayer </div><div>band : 1 (of 3 bands)</div><div>dimensions : 1416, 2558, 3622128 (nrow, ncol, ncell)</div><div>resolution : 0.0008333333, 0.0008333333 (x, y)</div><div>extent : -78.27649, -76.14482, 17.48716, 18.66716 (xmin, xmax, ymin, ymax)</div><div>coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0 </div><div>data source : /Users/carolineduffie/Documents/Trochilus/second_chapter/Analysis/PCA/sPCA/jamaica_elevation.tif </div><div>names : jamaica_elevation </div><div>values : 0, 255 (min, max)</div><div class="gmail-yj6qo"></div></div></div></div></div></div><div class="gmail-hi"></div></div><div class="gmail-ajx"></div></div><div class="gmail-gA gmail-gt gmail-acV" style="font-size:12.8px;border-bottom-left-radius:0px;border-bottom-right-radius:0px;border-top:none;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"><div class="gmail-gB gmail-xu"><div class="gmail-ip gmail-iq" style="margin-right:5px;padding-top:12px;padding-right:0px;padding-left:8px;border-top:1px solid rgb(216,216,216)"></div></div></div></div>
<br>_______________________________________________<br>adegenet-forum mailing list<br>adegenet-forum@lists.r-forge.r-project.org<br>https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum<br></div></div></body></html>