example_gt <- load_example_gt("gen_tbl")
# Create a second gen_tibble to merge
test_indiv_meta <- data.frame(
id = c("x", "y", "z"),
population = c("pop1", "pop1", "pop2")
)
test_genotypes <- rbind(
c(1, 1, 2, 1, 1),
c(2, 1, 2, 0, 0),
c(2, 2, 2, 0, 1)
)
test_loci <- data.frame(
name = paste0("rs", 1:5),
chromosome = paste0("chr", c(1, 1, 1, 1, 2)),
position = as.integer(c(3, 5, 65, 343, 23)),
genetic_dist = as.double(rep(0, 5)),
allele_ref = c("A", "T", "C", "G", "C"),
allele_alt = c("T", "C", NA, "C", "G")
)
test_gt <- gen_tibble(
x = test_genotypes,
loci = test_loci,
indiv_meta = test_indiv_meta,
valid_alleles = c("A", "T", "C", "G"),
quiet = TRUE
)
# Create an rbind report using rbind_dry_run
rbind_dry_run(example_gt, test_gt, flip_strand = TRUE)
Run the code above in your browser using DataLab