individual_to_donordata: Convert object of class 'individual' to donordata

Description Usage Arguments Value Author(s) See Also Examples

View source: R/individual_to_donordata.R

Description

This function returns the slots "id", "child" and "time", either separate or as a list from the individual object. The code assumes that slots "id", "child" and "time" are up-to-data and consistent with the other slots.

Usage

1

Arguments

x

An object of class individual.

element

Requested list elements. Can be "child", "time". The default NULL returns a list of both elements.

Value

If elements == "list", the function returns a list of "child" and "time". The function returns a "tibble" for the choices "child" and "time".

Author(s)

Stef van Buuren 2019

See Also

xyz-class, bse-class

Examples

1
2
3
4
5
6
7
library(donorloader)
smocc <- load_data(dnr = "smocc")
smocc_bs <- load_data(dnr = "smocc_bs")
p <- donordata_to_individual(dnr = "smocc", id = 10001)
p
q <- individual_to_donordata(p)
q

stefvanbuuren/minihealth documentation built on March 11, 2021, 7:10 p.m.