Skip to contents

This function takes a dataset and adds a new column filled with NA values.

Usage

construct_empty_var(dataset, column_name = "birth1j")

Arguments

dataset

A data frame to which the new column will be added.

column_name

The name of the new column to be added. Default is `"birth1j"`.

Value

A data frame with the new column added, containing NA values.

Examples

df <- data.frame(id = 1:5, name = c("Alice", "Bob", "Charlie", "David", "Eve"))
new_df <- construct_empty_var(df)
print(new_df)
#>   id    name birth1j
#> 1  1   Alice      NA
#> 2  2     Bob      NA
#> 3  3 Charlie      NA
#> 4  4   David      NA
#> 5  5     Eve      NA