fhir_melt_internal: Internal function to melt multiple entries in a data.table

View source: R/multiple_entries.R

fhir_melt_internalR Documentation

Internal function to melt multiple entries in a data.table

Description

This function handles the core melting operation for multiple entries in an indexed data.table. It is used internally by fhir_melt() to separate multiple entries in a given set of columns into individual rows.

Usage

fhir_melt_internal(indexed_dt, columns, brackets, sep, id_name, all_columns)

Arguments

indexed_dt

A data.table with indexed multiple entries.

columns

A character vector specifying the names of all columns that should be melted simultaneously. It is advisable to only melt columns that belong to the same repeating attribute.

brackets

A character vector of length two, defining the brackets used for the indices.

sep

A character vector of length one, the separator that was used when pasting together multiple entries.

id_name

A character vector of length one, the name of the column that will hold the identification of the origin of the new rows.

all_columns

A boolean indicating whether all columns should be returned (default is FALSE).

Value

A data.table where each entry from the variables in columns appears in a separate row.

See Also

fhir_melt(), fhir_rm_indices()


fhircrackr documentation built on April 11, 2025, 6:10 p.m.