You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2. Compute FIS across loci from GENIND object (per individual strata) and extract values to a newly dataframe 'FIS'
bc <-basic.stats(X)
FIS <-data.frame(bc$Fis)
3. Divide the distribution of FIS into 10 intervals and add values in the datadrame 'FIS'
FIS$POP.1 <- cut(FIS$POP1, c(-1.1,-0.8001,-0.5001,-0.3001,-0.1001,-0.0001,0.0999,0.2999,0.4999,0.7999,1.1),include.lowest=TRUE,
labels = c(-1,-0.8,-0.5,-0.3,-0.1,0.1,0.3,0.5,0.8,1))
# 4. Compute the abundance of each class and save values in the dataframe 'POP1'
A <-length(which(FIS$POP.1 == -1)); B <-length(which(FIS$POP.1 == -0.8))
C <-length(which(FIS$POP.1 == -0.5)); D <-length(which(FIS$POP.1 == -0.3))
E <-length(which(FIS$POP.1 == -0.1)); F <-length(which(FIS$POP.1 == 0.1))
G <-length(which(FIS$POP.1 == 0.3)); H <-length(which(FIS$POP.1 == 0.5))
I <-length(which(FIS$POP.1 == 0.8)); J <-length(which(FIS$POP.1 == 1))
cut <- c("[-1.0,-0.8[","[-0.8,-0.5[","[-0.5,-0.3[","[-0.3,-0.1[","[-0.1,0.0[","[0.0,0.1[","[0.1,0.3[","[0.3,0.5[","[0.5,0.8[","[0.8,1.0]")
values <- c(A,B,C,D,E,F,G,H,I,J)
POP1 <- data.frame(cut,values)
5. Plot each class as a histogram and save in image format (300 dpi)