rename_dl {metasnf}R Documentation

Rename features in a data_list

Description

Rename features in a data_list

Usage

rename_dl(data_list, name_mapping)

Arguments

data_list

A nested list of input data from generate_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)

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

summarize_dl(data_list, "feature")

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

data_list <- rename_dl(data_list, name_changes)

summarize_dl(data_list, "feature")

[Package metasnf version 1.1.2 Index]