[adegenet-forum] help with sPCA basics: plotting the raster map with xy points
Roman Luštrik
roman.lustrik at biolitika.si
Tue Nov 7 09:21:42 CET 2017
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.
Can you provide a small reproducible example?
Cheers,
Roman
----
In god we trust, all others bring data.
> Zahtevaj IJZ na https://kurc.biolitika.si
From: "Caroline Judy" <caroline.duffie at gmail.com>
To: adegenet-forum at lists.r-forge.r-project.org
Sent: Monday, November 6, 2017 9:37:15 PM
Subject: [adegenet-forum] help with sPCA basics: plotting the raster map with xy points
Dear Adegenet forum,
Sorry for the incomplete email I accidentally sent just a few minutes ago. Here's the full email:
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:
plot( data $ other $ topo.jam )
points( xy , col = "red" , pch = 20 )
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.
Thanks in advance for any assistance
---------------
/// GENIND OBJECT /////////
// 158 individuals; 6,451 loci; 12,902 alleles; size: 10.7 Mb
// Basic content
@tab: 158 x 12902 matrix of allele counts
@loc.n.all: number of alleles per locus (range: 2-2)
@loc.fac: locus factor for the 12902 columns of @tab
@all.names: list of allele names for each locus
@ploidy: ploidy of each individual (range: 2-2)
@type: codom
@call: read.structure(file = "~/Documents/Trochilus/second_chapter/Analysis/structure/input/GBS_all_pop_pheno.stru",
n.ind = 158, n.loc = 6451, onerowperind = TRUE, col.lab = 1,
col.pop = 2, col.others = 3:8, row.marknames = 0, ask = FALSE)
// Optional content
@pop: population of each individual (group size range: 6-37)
@strata: a data frame with 3 columns ( sex, phenotype, HI )
@other: a list containing: X xy topo topo.east topo.jam
--------------------------------------------------------------------------------------
$topo.jam
class : RasterLayer
band : 1 (of 3 bands)
dimensions : 1416, 2558, 3622128 (nrow, ncol, ncell)
resolution : 0.0008333333, 0.0008333333 (x, y)
extent : -78.27649, -76.14482, 17.48716, 18.66716 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0
data source : /Users/carolineduffie/Documents/Trochilus/second_chapter/Analysis/PCA/sPCA/jamaica_elevation.tif
names : jamaica_elevation
values : 0, 255 (min, max)
_______________________________________________
adegenet-forum mailing list
adegenet-forum at lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20171107/637b5f8e/attachment.html>
More information about the adegenet-forum
mailing list