read_speciome: Read speciome simulation data

View source: R/read_speciome.R

read_speciomeR Documentation

Read speciome simulation data

Description

Combine data from one simulation, saved as binary files, into a single tibble.

Usage

read_speciome(root, variables, ncols = rep(1, length(variables)))

Arguments

root

Path to the simulation folder

variables

Vector of names of variable to read (e.g. c("time", "trait_Fst"))

ncols

Vector or list indicating how to split or duplicate each variable when constructing the tibble. There must be one element per variable. See ?as_tibble_speciome for details.

Details

Each variable is read as a vector and reshaped into a tibble by being passed, with its corresponding ncols, to as_tibble_speciome. The resulting tibbles for all variables are then bound together by column.

Value

A tibble containing the simulation data

Note

Do not provide the extension of the data files in variables (".dat").

See Also

as_tibble_speciome

Examples


root <- system.file("extdata", "sim-example", package = "speciomer")
read_speciome(root, "time")
read_speciome(root, c("time", "EI"))
read_speciome(root, c("time", "trait_Fst"), ncol = c(1, 3))
read_speciome(root, c("time", "trait_Fst"), ncol = c(-3, 1))


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