fhir_rm_indices: Remove indices from data.frame/data.table

View source: R/multiple_entries.R

fhir_rm_indicesR Documentation

Remove indices from data.frame/data.table

Description

Removes the indices in front of multiple entries as produced by fhir_crack() when brackets are provided in the design.

Usage

fhir_rm_indices(
  indexed_data_frame,
  brackets = c("<", ">"),
  columns = names(indexed_data_frame)
)

Arguments

indexed_data_frame

A data frame with indices for multiple entries as produced by fhir_crack()

brackets

A character vector of length two defining the brackets that were used in fhir_crack()

columns

A character vector of column names, indicating from which columns indices should be removed. Defaults to all columns.

Value

A data frame without indices.

See Also

fhir_melt()

Examples


#unserialize example
bundles <- fhir_unserialize(bundles = example_bundles1)

patients <- fhir_table_description(resource = "Patient")

df <- fhir_crack(bundles = bundles,
                  design = patients,
                  brackets = c("[", "]"))

df_indices_removed <- fhir_rm_indices(indexed_data_frame = df, brackets=c("[", "]"))


POLAR-fhiR/fhircrackr documentation built on Dec. 24, 2024, 3:06 a.m.