Skip to contents

This function is used to create a list object by converting two-column data frame based on tibble::deframe framework. The list object will be named based on the first column values.

Usage

deframe_as_list(x, col_names = NULL)

Arguments

x

A data.frame

col_names

Column names

Value

A named list object

Details

Please see tibble::deframe for more information.

Examples


# Example data
example_data <- tibble::tibble(
  SCORE_SOURCE = c("ADASQ4SCORE", "MMSE", "LDELTOTL", "DIGITSCR", "TRABSCOR"),
  VISCODE2 = c("bl", "sc", "bl", "bl", "bl")
)

# Create a list object
deframe_as_list(
  x = example_data,
  col_names = NULL
)
#> $ADASQ4SCORE
#> [1] "bl"
#> 
#> $MMSE
#> [1] "sc"
#> 
#> $LDELTOTL
#> [1] "bl"
#> 
#> $DIGITSCR
#> [1] "bl"
#> 
#> $TRABSCOR
#> [1] "bl"
#> 

deframe_as_list(
  x = example_data,
  col_names = c("SCORE_SOURCE", "VISCODE2")
)
#> $ADASQ4SCORE
#> [1] "bl"
#> 
#> $MMSE
#> [1] "sc"
#> 
#> $LDELTOTL
#> [1] "bl"
#> 
#> $DIGITSCR
#> [1] "bl"
#> 
#> $TRABSCOR
#> [1] "bl"
#>