jgx65 / hierfstat

the hierfstat package
24 stars 14 forks source link

Impossible to find "fstat" function #40

Closed Vsonn closed 3 years ago

Vsonn commented 3 years ago

Hello,

I have only little experience with R and received a script to analyse data from microsatellites. In this script, the "fstat" function is used to provide the three F statistics Fst (pop/total), Fit (Ind/total), and Fis (ind/pop). However I get the message from R that the function is unknown.

gen
/// GENIND OBJECT /////////

 // 239 individuals; 11 loci; 81 alleles; size: 113.7 Kb

 // Basic content
   @tab:  239 x 81 matrix of allele counts
   @loc.n.all: number of alleles per locus (range: 2-22)
   @loc.fac: locus factor for the 81 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 = paste(dat.path1, "Results_form_structure.str", 
    sep = ""), n.ind = 239, n.loc = 11, onerowperind = F, 
    col.lab = 1, col.pop = 2, col.others = NULL, row.marknames = 1, 
    NA.char = "-9", pop = NULL, sep = NULL, ask = F, quiet = F)

 // Optional content
   @pop: population of each individual (group size range: 19-20)
fstat(gen)
Error in fstat(gen) : impossible de trouver la fonction "fstat"

I could not find whether the function was changed or removed. It would be of great help if you can help me with that.

Thank you

jgx65 commented 3 years ago

fstat is not part of the distribution of hierfstat. In order to obtain FST and FIS, you could use either wc(gen), which gives Weir and Cockerham estimates of the corresponding quantities, or basic.stats(gen), which gives Nei & Chesser's

jgx65 commented 3 years ago

@Vsonn , is the problem solved and can I close the issue? Cheers