Learn R Programming

rsdv (version 0.2.0)

set_column_type: Set the type of a column in metadata

Description

Set the type of a column in metadata

Usage

set_column_type(meta, column, type)

Value

The updated rsdv_metadata object (for piping).

Arguments

meta

An rsdv_metadata object.

column

Column name (character).

type

One of "numerical", "categorical", "boolean", "datetime", "id".

For categorical columns the level order used by the synthesizer follows the input: a factor keeps its levels() order (including ordered factors), while a plain character column gets a sorted unique-value order for determinism. The sort is lexicographic, so numeric-like character columns (c("2", "10")) come back ordered "10", "2". Coerce these to factor with the desired level order before fitting if order matters.

Examples

Run this code
metadata() |> set_column_type("age", "numerical")

Run the code above in your browser using DataLab