rename_dl: Rename features in a data list

View source: R/data_list.R

rename_dlR Documentation

Rename features in a data list

Description

Rename features in a data list

Usage

rename_dl(dl, name_mapping)

Arguments

dl

A nested list of input data from data_list().

name_mapping

A named vector where the values are the features to be renamed and the names are the new names for those features.

Value

A data list ("list"-class object) with adjusted feature names.

Examples

library(metasnf)

dl <- data_list(
    list(pubertal, "pubertal_status", "demographics", "continuous"),
    list(anxiety, "anxiety", "behaviour", "ordinal"),
    list(depress, "depressed", "behaviour", "ordinal"),
    uid = "unique_id"
)

summary(dl, "feature")

name_changes <- c(
    "anxiety_score" = "cbcl_anxiety_r",
    "depression_score" = "cbcl_depress_r"
)

dl <- rename_dl(dl, name_changes)

summary(dl, "feature")

metasnf documentation built on April 3, 2025, 5:40 p.m.