Hello Thibaut and List,<br><br>I have a few questions regarding plotting and interpreting an spca. Our data set consists of georeferenced individuals unevenly sampled in space and genotyped at nuclear microsatellite loci. Because the samples are unevenly distributed I chose the inverse distance connection network (option 7). We have a few interpretable global axes and for our situation the contour plot with s.image seems to be a nice display. The code I have used for the following questions is pasted below the main body of the text. <br>
<br>My main question is how is empty space interpolated in this plot (s.image) and can I alter the method if needed? I am getting some peripheral contours where there is no data which may be expected depending on how the data are being interpolated. I can "fix" this by increasing the value for the "span" argument (degree of smoothing) from the default of 0.5 but I am not entirely clear what the "span" argument is actually altering. Would increasing span be generally appropriate given that I have unevenly distributed samples and I am looking at global axes of variation? As I alter span the plot certainly changes. For a given sample size and scheme, is there a rule of thumb to choose the most 'honest' span value for this type of plot with genetic data? <br>
<br>My next question involves adding individual samples to the plot. I suspect this is easy but I'm stuck. I have plotted the figure on a map outline of the area (using the area argument) but can't seem to plot individuals on the map. <br>
<br>I understand that all of my questions can be handled in a GIS but I am interested in learning the R way.<br><br>Thanks very much for any help.<br><br>Colin<br><br><br>library(adegenet)<br>
library(ade4)<br>library(adehabitat)<br>library(rgdal)<br><br>##Reads genetic and location data<br>
ds1<-read.structure("APPHybridFinalJune2009sPCAInput.stru", n.ind=217, n.loc=12, onerowperind=T, col.lab=1, col.pop=2, col.others=0, row.marknames=0, NA.char="-9", missing=NA, ask=TRUE, quiet=FALSE)<br>
<br>xy<-read.table("xy.txt", header = T)<br><br>##Reads in shape file and converts it to area object<br>ont<-readOGR("C:\\Documents and Settings\\Colin\\Desktop\\Wolf", "ONTARIO")<br><br>
areaont<-spol2area(ont)<br><br>##Performs and plots spca on shape file<br><br>mySpca2 <- spca(ds1, type = 7, ask = FALSE, scannf = FALSE, xy = xy, nfposi = 8, nfnega = 8)<br><br>s.image(xy,mySpca2$li[,1], include.ori = FALSE, grid = F, kgrid = 30, cgrid = 0, sub = "1st global axis", csub = 1.25, possub = "topleft", area = areaont)<br>
<br><br><br><br><br clear="all"><br>-- <br>Colin Garroway (PhD candidate)<br>Wildlife Research and Development Section<br>Ontario Ministry of Natural Resources<br>Trent University, DNA Building<br>
2140 East Bank Drive<br>Peterborough, ON, K9J 7B8<br>
Canada<br><br><a href="http://colin.garroway.googlepages.com/home" target="_blank">http://colin.garroway.googlepages.com/home</a><br>