Description Usage Arguments Value See Also Examples
Prints summary of sgsObj data structure
1 2 |
object |
An sgsObj to be summarized |
... |
arguments passed to summary |
A printed summary of..
The number of individuals
The number of categories (analyses based on categories not yet implemented)
Number of loci
Number of alleles per locus
Number of gene copies per locus
The percentage of missing data per locus
createSgsObj
for how to create a sgsObj
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ## Simulate genetic data
Nind = 100 # Number of individuals
Nloci = 5 # Number of loci
Nallele = 10 # Number of alleles per loci
## Set up data frame and generate random spatial locations
dat <- data.frame(id = 0:(Nind - 1))
dat$x = runif(Nind, 0, 100)
dat$y = runif(Nind, 0, 100)
## Simulate Random genetic data and assign loci names
for (loci in 1:Nloci) {
loci_name_a = paste("Loc", loci, "_A", sep = "")
loci_name_b = paste("Loc", loci, "_B", sep = "")
dat[loci_name_a] <- sample.int(Nallele, Nind, replace = TRUE)
dat[loci_name_b] <- sample.int(Nallele, Nind, replace = TRUE)
}
## Convert to sgsObj
sgsObj = createSgsObj(sample_ids = dat$id,
genotype_data = dat[, 4:(Nloci*2 + 3)],
ploidy = 2,
x_coords = dat$x,
y_coords = dat$y)
summary(sgsObj)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.