read_sumstats {MungeSumstats}R Documentation

Determine summary statistics file type and read them into memory

Description

Determine summary statistics file type and read them into memory

Usage

read_sumstats(
  path,
  nThread = 1,
  nrows = Inf,
  standardise_headers = FALSE,
  mapping_file = sumstatsColHeaders
)

Arguments

path

Filepath for the summary statistics file to be formatted. A dataframe or datatable of the summary statistics file can also be passed directly to MungeSumstats using the path parameter.

nThread

Number of threads to use for parallel processes.

nrows

integer. The (maximal) number of lines to read. If Inf, will read in all rows.

standardise_headers

Standardise headers first.

mapping_file

MungeSumstats has a pre-defined column-name mapping file which should cover the most common column headers and their interpretations. However, if a column header that is in youf file is missing of the mapping we give is incorrect you can supply your own mapping file. Must be a 2 column dataframe with column names "Uncorrected" and "Corrected". See data(sumstatsColHeaders) for default mapping and necessary format.

Value

data.table of formatted summary statistics

Examples

path <- system.file("extdata", "eduAttainOkbay.txt",
    package = "MungeSumstats"
)
eduAttainOkbay <- read_sumstats(path = path)

[Package MungeSumstats version 1.2.3 Index]