get_locus_data_n: Extract data for one locus (nested)

View source: R/get_locus_data_n.R

get_locus_data_nR Documentation

Extract data for one locus (nested)

Description

Same as get_locus_data but extracting from a data frame nested by locus (which is much faster).

Usage

get_locus_data_n(i, data_n, variables, add_time = FALSE)

Arguments

i

Index of the locus to extract data for

data_n

Locus-wise data frame trough time (see ?read_loci), nested by locus (use dplyr::group_by and tidyr::nest to get that)

variables

String vector with the names of the columns to extract

add_time

Whether or not to extract the "time" column as well

Value

A tibble

See Also

read_loci, dplyr::group_by, tidyr::nest

Examples


root <- system.file("extdata", "sim-example", package = "speciomer")
data <- read_loci(root, "Fst")
data <- data %>% dplyr::group_by(locus) %>% tidyr::nest()
get_locus_data_n(1, data, "Fst")


rscherrer/speciomer documentation built on March 11, 2023, 5:37 p.m.