text: user993: I have a distance matrix generated by hierfstat, thusly, with a link to the fasta file here:
  library(adegenet)
  library(hierfstat)
  snps <- fasta2DNAbin('test.fa', chunkSize = 50)
  gi <- DNAbin2genind(snps)
  # manually define the populations for passing to pairwise.fst
  p <- c('Botswana', 'Botswana', 'Botswana', 'Botswana', 'France', 'France', 'Vietnam', 'Vietnam', 'Uganda', 'Uganda', 'Uganda', 'Uganda', 'Vietnam', 'Vietnam', 'Laos', 'Laos', 'Laos', 'Vietnam', 'Vietnam', 'Vietnam', 'Vietnam', 'Vietnam')
  f <- pairwise.fst(gi, p, res.type = c('dist', 'matrix'))
  as.matrix(f)
  
  which produces
      1   2   3   4   5
  1   0   0.2189008   0.225567409 0.1821518   0.259409722
  2   0.2189008   0   0.130736953 0.1648034   0.191050772
  3   0.2255674   0.130737    0   0.1669077   0.006396789
  4   0.1821518   0.1648034   0.166907683 0   0.203931457
  5   0.2594097   0.1910508   0.006396789 0.2039315   0
  
  Is it safe to assume that 1 = Botswana, 2 = France, 3 = Vietnam, 4 = Uganda and 5 = Laos? i.e. that the distance matrix rows/columns follow the order that each population first appeared in p?
  Is there a way to determine for certain, which row/column in the distance matrix corresponds to which population?
  
  user787: Disclaimer: I don't have adagenet and hierfstat installed, I just looked at the source code. It seems like pairwise.fst (the deprecated code from the adagenet package, which you seem to be using) already returns a matrix. Set res.type="matrix" and try calling rownames(f) and colnames(f) afterwards.
  
original_text: 993: <p>I have a distance matrix generated by hierfstat, thusly, with a link to the fasta file <a href="https://www.dropbox.com/s/z9n89y080hvl3s2/2017.06.13.strucutre_test.masked.snp_sites.v2_3_2.subsample.fa?dl=0" rel="noreferrer">here</a>:</p>
  
  <pre><code>library(adegenet)
  library(hierfstat)
  snps &lt;- fasta2DNAbin('test.fa', chunkSize = 50)
  gi &lt;- DNAbin2genind(snps)
  # manually define the populations for passing to pairwise.fst
  p &lt;- c('Botswana', 'Botswana', 'Botswana', 'Botswana', 'France', 'France', 'Vietnam', 'Vietnam', 'Uganda', 'Uganda', 'Uganda', 'Uganda', 'Vietnam', 'Vietnam', 'Laos', 'Laos', 'Laos', 'Vietnam', 'Vietnam', 'Vietnam', 'Vietnam', 'Vietnam')
  f &lt;- pairwise.fst(gi, p, res.type = c('dist', 'matrix'))
  as.matrix(f)
  </code></pre>
  
  <p>which produces</p>
  
  <pre><code>    1   2   3   4   5
  1   0   0.2189008   0.225567409 0.1821518   0.259409722
  2   0.2189008   0   0.130736953 0.1648034   0.191050772
  3   0.2255674   0.130737    0   0.1669077   0.006396789
  4   0.1821518   0.1648034   0.166907683 0   0.203931457
  5   0.2594097   0.1910508   0.006396789 0.2039315   0
  </code></pre>
  
  <p>Is it safe to assume that 1 = Botswana, 2 = France, 3 = Vietnam, 4 = Uganda and 5 = Laos? i.e. that the distance matrix rows/columns follow the order that each population first appeared in <code>p</code>?</p>
  
  <p>Is there a way to determine for certain, which row/column in the distance matrix corresponds to which population?</p>
   787: <p>Disclaimer: I don't have adagenet and hierfstat installed, I just looked at the source code. It seems like pairwise.fst (the deprecated code from the adagenet package, which you seem to be using) already returns a matrix. Set res.type="matrix" and try calling <code>rownames(f)</code> and <code>colnames(f)</code> afterwards.</p>
  