import_rif: Import a RIF formatted file into a tibble

View source: R/import_rif.R

import_rifR Documentation

Import a RIF formatted file into a tibble

Description

Reads a file that is stored in RIF format and returns a tibble. The function validates the presence of required fields, and checks whether the variable names in the data match the specified distribution.

Usage

import_rif(file)

Arguments

file

Either a path to a file, a connection, or literal data (either a single string or a raw vector).

Files ending in .gz, .bz2, .xz, or .zip will be automatically uncompressed. Files starting with ⁠http://⁠, ⁠https://⁠, ⁠ftp://⁠, or ⁠ftps://⁠ will be automatically downloaded. Remote gz files can also be automatically downloaded and decompressed.

Literal data is most useful for examples and tests. To be recognised as literal data, the input must be either wrapped with I(), be a string containing at least one new line, or be a vector containing at least one string with a new line.

Using a value of clipboard() will read from the system clipboard.

Value

An object of class reference, basically a tibble with an attribute called study.

Author(s)

Stef van Buuren 2021

Examples

fn <- system.file("testdata/nl_2009_hgt_male_nl.txt", package = "centile")
myref <- import_rif(fn)

growthcharts/yzy documentation built on Oct. 28, 2024, 10:32 a.m.